谁帮我改改这段JS代码,实现一个值班表,每周一自动换班_百度知道
谁帮我改改这段JS代码,实现一个值班表,每周一自动换班
length];;同志3';/谁帮我改改这段JS代码,',' / } document,轮流if (todayDate.getTime()/script type=text//每周星期一换下一个值班人;/ /,能控制启用程序的那天由谁值班;同志1',实现一个值班表,' var now=new Date();李四'把需要排班的姓名按照排班顺序写在下面一行里面就可以 var pers=new Array('调整下面的调整因子;/,',每周一自动换班<,以后都能自动更新显示 var ctrl_param=1;同志6'var weeks=parseInt().getDay() == 1)weeks=weeks+1return pers[(days+ctrl_param) %/,'24/张三'javascript&todayDate = new Date();同志5',' function zhibanren(){ /.write(zhibanren());;同志2',';同志4' &script>
你原来弄复杂了,','。然后再根据总天数/); } alert(zhibanren());;
var now=new Date().getTime()/同志5';3600/李四',所以你得把除出来的天数+3倒退到星期一;同志3'张三',' 主要就是+3 那里,',那天是星期四;;1000+3);
return pers[(parseInt(days /。getTime() 返回的是当前时间距日的毫秒数;
var ctrl_param=2,'function zhibanren(){
var pers=new Array(';同志4' var days=parseInt(now。剩下的事就简单了;;同志1','同志2'同志6',';24/;7)+ctrl_param) % pers.length];7 就可得到距那天有多少个周
其他类似问题
为您推荐:
js代码的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁请C#大神帮我解释下这段代码的意思,最好是详细点儿,谢谢啦_百度知道
请C#大神帮我解释下这段代码的意思,最好是详细点儿,谢谢啦
这是 自动考试系统 上 开始考试 按钮的代码private void btnStart_Click(object sender, EventArgs e)
string StrSql=&&;
if (this.btnStart.Text == &开始考试&)
this.label3.Text = DateTime.Now.ToShortTimeString();
StrSql = &Update tbl_XuanKe set stats='T' where classid='& + this.cmbClass.Text.Substring(0, 3) + &' and kcid='& + this.cmbKeMu.Text.Substring(0, 2) + &'&;
this.timer1.Enabled =
this.btnStart.Text = &停止考试&;
this.cmbClass.Enabled = cmbKeMu.Enabled =
StrSql = &Update tbl_XuanKe set stats='F' where classid='& + this.cmbClass.Text.Substring(0, 3) + &' and kcid='& + this.cmbKeMu.Text.Substring(0, 2) + &'&;
this.timer1.Enabled =
this.btnStart.Text = &开始考试&;
this.cmbClass.Enabled = cmbKeMu.Enabled =
if (MyClass.ExecuteDate(StrSql) & 0)
MessageBox.Show(&考试开始出错!&);
listView1.Items.Clear();
DataSet myset1 = new DataSet();
订姬斥肯俪厩筹询船墨
myset1 = MyClass.QueryDate(&select nostudent,name from studentname where banji='& + cmbClass.Text.Substring(0, 3) + &'&);
for (int i = 0; i & myset1.Tables[0].Rows.C i++)
ListViewItem aa = new ListViewItem();
aa.ImageIndex = 0;
aa.Text = myset1.Tables[0].Rows[i][0].ToString() +&_&+ myset1.Tables[0].Rows[i][1].ToString();
this.listView1.Items.Add(aa);
提问者采纳
&&&private&void&btnStart_Click(object&sender,&EventArgs&e)&&&&&&&&{&&&&&&&&&&&&string&StrSql=&&;//这个不说了嘛&&&&&&&&&&&&if&(this.btnStart.Text&==&&开始考试&)//如果按钮是&开始考试&&&&&&&&&&&&&{&&&&&&&&&&&&&&&&this.label3.Text&=&DateTime.Now.ToShortTimeString();//label3显示系统时间&&&&&&&&&&&&&&&&StrSql&=&&Update&tbl_XuanKe&set&stats='T'&where&classid='&&+&this.cmbClass.Text.Substring(0,&3)&+&&'&and&kcid='&&+&this.cmbKeMu.Text.Substring(0,&2)&+&&'&;&&&&&&&&&&&&&&&&//给StrSQl赋一个查询语句值
this.timer1.Enabled&=&//定时器开始&&&&&&&&&&&&&&&&this.btnStart.Text&=&&停止考试&;//按钮显示&停止考试&&&&&&&&&&&&&&&&&this.cmbClass.Enabled&=&cmbKeMu.Enabled&=&//按钮无效&&&&&&&&&&&&}&&&&&&&&&&&&else//不是&开始考试&&&&&&&&&&&&&{&&&&&&&&&&&&&&&&//这里是更新数据库
StrSql&=&&Update&tbl_XuanKe&set&stats='F'&where&classid='&&+&this.cmbClass.Text.Substring(0,&3)&+&&'&and&kcid='&&+&this.cmbKeMu.Text.Substring(0,&2)&+&&'&;&&&&&&&&&&&&&&&&this.timer1.Enabled&=&//定时器停止&&&&&&&&&&&&&&&&this.btnStart.Text&=&&开始考试&;&&&&&&&&&&&&&&&&this.cmbClass.Enabled&=&cmbKeMu.Enabled&=&//控件有效&&&&&&&&&&&&}&&&&&&&&&&&&if&(MyClass.ExecuteDate(StrSql)&&&0)//这里应该是你程序中自动义类里面的一个方法吧?&&&&&&&&&&&&{&&&&&&&&&&&&&&&&MessageBox.Show(&考试开始出错!&);&&&&&&&&&&&&&&&&//返回,后面的程序不执行。&&&&&&&&&&&&}&&&&&&&&&&&&listView1.Items.Clear();//listView中数据清空&&&&&&&&&&&&DataSet&myset1&=&new&DataSet();//实例化DataTable。
//这里是查询数据库语句,这里就开始链接数据库了,访问数据库的studentname工作表&&&&&&&&&&&&myset1&=&MyClass.QueryDate(&select&nostudent,name&from&studentname&where&banji='&&+&cmbClass.Text.Substring(0,&3)&+&&'&);&&&&&&&&&&&&for&(int&i&=&0;&i&&&myset1.Tables[0].Rows.C&i++)//获取studentname表格中的行数,该表格目前放在maset1的第一张表格里面&&&&&&&&&&&&{&&&&&&&&&&&&&&&&&ListViewItem&aa&=&new&ListViewItem();&&&&&&&&&&&&&&&&&aa.ImageIndex&=&0;
&//获取表格中的每行内容,目测你的&studentname只有2列。&&&&&&&&&&&&&&&&&aa.Text&=&myset1.Tables[0].Rows[i][0].ToString()&+&_&+ 订姬斥肯俪厩筹询船墨;myset1.Tables[0].Rows[i][1].ToString();&&&&&&&&&&&&&&&&&this.listView1.Items.Add(aa);//把每行的内容添加到listView1控件里面以供显示。
&//弱弱问一个,为何要用ListView呢,而不用datagridview。&&&&&&&&&&&&&}&&&&&&&&}&&&&//数据太多(上万条数据)的话,你的这个代码,软件估计会卡死或者假死,出现无响应的现象。
我不知道呢,谢谢你,虽然我还是不懂
用datagridview,绑定数据源。你下面的代码:for&(int&i&=&0;&i&&&myset1.Tables[0].Rows.C&i++)//获取studentname表格中的行数,该表格目前放在maset1的第一张表格里面&&&&&&&&&&&&{&&&&&&&&&&&&&&&&&ListViewItem&aa&=&new&ListViewItem();&&&&&&&&&&&&&&&&&aa.ImageIndex&=&0;&&&&&&&&&&&&&&&&&//获取表格中的每行内容,目测你的&studentname只有2列。&&&&&&&&&&&&&&&&&aa.Text&=&myset1.Tables[0].Rows[i][0].ToString()&+&_&+&myset1.Tables[0].Rows[i][1].ToString();&&&&&&&&&&&&&&&&&this.listView1.Items.Add(aa);//把每行的内容添加到listView1控件里面以供显示。&&&&&&&&&&&&&&&&&//弱弱问一个,为何要用ListView呢,而不用datagridview。&&&&&&&&&&&&&}就可以换成:datagridview.DataSource=myset1.Tables[0];一句代码就搞定。你用个for循环,一条一条往ListView中添加,速度太慢。
提问者评价
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁哪位大侠帮我把下面的JS 代码用C#写出来,非常感谢!_百度知道
哪位大侠帮我把下面的JS 代码用C#写出来,非常感谢!
0);var RoadPolyline =&););++ContentCreatorWindow&
SetPanel(var LeftOvar lastImageR
Reset (0.attachEvent(&].teC;var roadGroup =.toAbspath(&
if (type==2)
var IObject =JavaScript&
lastId =;RoadRightImg&0&.gif".&;ErrorOper = GetParamValue (".setName(&script>.showPopup (new SGNotification ("&
Junction = null, OnFrame);var JunctionX .split(&)
catch(e) {globe!= &var InEparams&var InitDone =}
SetPanel(operation.UnregisterName (",&script language=",5000)): ContentCreatorW
lastImageLeft =);var RestoringProperties =
RoadNumPoints = 0.all[":var globe = null.GetObjectEx (operation);
catch(e) {a=1;script>.IInformationTree, window);var ResetDone = false.GetGlobalName (&RoadsSpan&SCRIPT Language=&script src=&
operation = parseInt(sep[1]);javascript".teCore.attachEvent(&
type = parseInt(sep[0]);var Junction =var RoadVerts = new A]./&var JunctionY ;
lastImageRight = document./var lastId.IScriptERoad Builder&try { }catch(e) {globe.focus(););}&&onFrame&
NewObject =
TrafficLight = null.all[&onRButtonDown&], OnRButtonDown);;0& src=&var NewObject =}
try {;function Init(){
globe = new SGWorld();/.all[&RoadTextures/, OnInputModeChanged);
= 0.var RoadTextureFileName.&;>.showPopup (new SGNotification (&}
InEdit = 0;RoadLeftImg&);
LeftOver = 0.RegisterGlobalName (&&,true);Error while trying to register ToolsEditorW
RestorePropertiesFrom(IObject);
RoadPolyline =road-2-2.,&);onLButtonDown&var ContentWindow =ToolsCommon.attachEvent(&;var FoundPolyline.IScriptE
DrawingGroup = new SGNode(parseInt(sep[2])).js",false);
InEditEx = 0;
InEdit = 0;
JunctionY = 0;
RoadTextureFileName = SGAPI;ToolsEditorWindow&&/.teCvar lastImageLvar DrawingGroup = null.teCvar TrafficLight = null,5000)).IScriptEngine.attachEvent(&var RoadNumPonInputModeChanged&
}catch(e) {a=0;ToolsEditorWindow&>, OnLButtonDown);script&var InEditEx;}
ContentWindow = globe.js"
提问者采纳
你直接把var改成相应的类型就行了。然后在相应的位置调用Init()这个方法
没那么简单吧,又有好多方法C#里都找不到
方法没找到,可能是你没有添加引用。
提问者评价
其他类似问题
为您推荐:
其他2条回答
支持一下,没学这个专业!
就是用c#做用户界面是么,你把完整代码发过来,下面body部分
不是做用户界面,实现JS的功能就可以了
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁求大神帮我把这段C#代码翻译成C++_百度知道
求大神帮我把这段C#代码翻译成C++
val>, int lParam)
EnumChildWindows(货品\, @&val2&/.Trim().EnableWindow(k;
/.*;/, int lParam)
var title = new StringBuilder(200); 父窗口标题数组
string[] aSzWinName = { ", CallBackEnumChildWval&
var t = title, IntPtr,是否继续.Z
var isMatch2 = System.FindWindow(aSzClassName[0];{
/user32, aSzWinName[i]).IsMatch(t;);
[DllImport(".Text, CallB
/#32770", @&
public static bool WindowProcess(int hwnd?&
public static bool ChildWindowProcess(int hWnd.RegularExpressions.ToInt32();/.R
/?& i <, 0)!单据是否保存;
Win32;]的单价小于成本价;/
Win32;]的单价小于最低销售价\, aSzWinName[0])?)\/.dll&[(!= IntPButton"?)\
public static CallBack CallBackEnumWindows = new CallBack(WindowProcess)private static int _yesCode = 0?)\
[DllImport(&);
catch (Exception)
var isMatch1 = S)]
public static extern int EnumWindows(CallB((, CallBackEnumChildWindows.IntPtr MyFindWindow()
const int myMaxParentWinCount = 2;)
_yesCode = hWnd.IntPtr hLastWin = Win32.Zero)
EnumChildWindows(
}private static S是(&Y)".R)]
public static extern bool EnumChildWindows(int hWndP
/.T myMaxParentWinCount.Show(t), 0);
var parent = hLastW}
if (t == ", ".ToString();
return true, &;/ 逐次用FindWindowEx函数求出各级子窗口
for (int i = 1;货品\, aSzClassName[i];/.IsMatch(t;是(&Y)", 200)?& }.GetWindowText(hW?<, false), title, int lParam).FindWindowEx(hLastW?& 首先求得顶级父窗口
S 父窗口类名数组
string[] aSzClassName = { & };);
if (isMatch1 || isMatch2)
var k = new IntPtr(_yesCode);
private static bool TestForMessageBox()
var k = MyFindWindow();
if (hLastWin .RegularExpressions!= null)
/user32;
return hLastWif (t .*.*;询问", int lParam);
hLastWin = Win32;/.dll&
public static CallBack CallBackEnumChildWindows = new CallBack(ChildWindowProcess);
public static CallBack CallBackEnumThreadWindows = new CallBack(ThreadWindowProcess)
没事了大家我解决了
我有更好的答案
问题补充:私有静态int _yesCode = 0;[user32 DllImport(”。DLL)]公共静态走读生保龄球EnumChildWindows(int,int hWndParent,回调LPFN lParam);[user32 DllImport(”。DLL)]公共静态extern int EnumWindows(回调LPFN,int lParam);私有静态弯曲件TestForMessageBox(){ try { Var k = MyFindWindow(),返回} catch(异常){返回false。把;} }私有静态系统。MyFindWindow IntPtr(){ Const int myMaxParentWinCount = 2;/ /数组的父窗口类名的String[]aSzClassName = { & # 32770”、“按钮”},/ /父窗口标题的String[]数组aSzWinName = {“问”、“是(& Y)& };/ /顶级父窗口首先系统。hLastWin IntPtr = Win32。FindWindow(aSzClassName[0],aSzWinName[0]);Var父= hLastW/ /连续FindWindowEx函数和各级...
你是在翻译英文吗
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}