/// <summary> /// 加载并绑定盈利情况 /// </summary> private void LoadPhoto() { string strSQL = string.Empty; string strDiv = string.Empty; strSQL = "Select top 100 * from XMFight_Image order by ITop desc,CTime desc"; if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { strDiv = "<div class=\"col-xs-12 col-sm-10 col-sm-offset-1\">"; for (int i = 0; i < OP_Mode.Dtv.Count; i++) { if (i == 0) {// 输出表头 strDiv += "<div class=\"timeline-container\">"; strDiv += " <div class=\"timeline-label\">"; strDiv += " <span class=\"label label-primary arrowed-in-right label-lg\">"; strDiv += " <b>" + Convert.ToDateTime(OP_Mode.Dtv[i]["CTime"]).ToString("yyyy-MM-dd dddd") + "</b>"; strDiv += " </span>"; strDiv += " </div>"; strDiv += " <div class=\"timeline-items\">"; /// 同日循环 strDiv += " <div class=\"timeline-item clearfix\">"; strDiv += " <div class=\"timeline-info\">"; //if (OP_Mode.Dtv[i]["Remark"].ToString().Length > 0) //{ strDiv += " <i class=\"icon-credit-card bigger-230 green\"></i>"; strDiv += " </div>"; strDiv += " <div class=\"widget-box transparent\">"; strDiv += " <div class=\"widget-header widget-header-small\">"; // strDiv += " <B><span class=\"green\">" + OP_Mode.Dtv[i]["Remark"].ToString() + "</span></B> [<a href=\"BanceAdd.aspx?ID=" + OP_Mode.Dtv[i]["ID"].ToString() + "\">编辑</a>]"; ///消费金额 strDiv += " <B><span class=\"green\">" + OP_Mode.Dtv[i]["Remark"].ToString() + "</span></B> "; ///消费金额 strDiv += " </div>"; // } strDiv += " <div class=\"widget-body\">"; strDiv += " <div class=\"widget-main\">"; strDiv += " <img src=\"" + OP_Mode.Dtv[i]["ImageName"].ToString() + "\" class=\"img-rounded\" style=\"max-width:90%\" />"; ///说明信息 strDiv += " </div>"; strDiv += " </div>"; strDiv += " </div>"; ////////////// } if (i > 0) { if (Convert.ToDateTime(OP_Mode.Dtv[i - 1]["LTime"]).ToString("yyyy-MM-dd") != Convert.ToDateTime(OP_Mode.Dtv[i]["LTime"]).ToString("yyyy-MM-dd")) { strDiv += " </div>"; /// 上个日期循环结束 strDiv += "<div class=\"timeline-container\">"; strDiv += " <div class=\"timeline-label\">"; strDiv += " <span class=\"label label-primary arrowed-in-right label-lg\">"; strDiv += " <b>" + Convert.ToDateTime(OP_Mode.Dtv[i]["CTime"]).ToString("yyyy-MM-dd dddd") + "</b>"; strDiv += " </span>"; strDiv += " </div>"; strDiv += " <div class=\"timeline-items\">"; /// 同日循环 strDiv += " <div class=\"timeline-item clearfix\">"; strDiv += " <div class=\"timeline-info\">"; //if (OP_Mode.Dtv[i]["Remark"].ToString().Length > 0) //{ strDiv += " <i class=\"icon-credit-card bigger-230 green\"></i>"; strDiv += " </div>"; strDiv += " <div class=\"widget-box transparent\">"; strDiv += " <div class=\"widget-header widget-header-small\">"; // strDiv += " <B><span class=\"green\">" + OP_Mode.Dtv[i]["Remark"].ToString() + "</span></B> [<a href=\"BanceAdd.aspx?ID=" + OP_Mode.Dtv[i]["ID"].ToString() + "\">编辑</a>]"; ///消费金额 strDiv += " <B><span class=\"green\">" + OP_Mode.Dtv[i]["Remark"].ToString() + "</span></B> "; ///消费金额 strDiv += " </div>"; // } strDiv += " <div class=\"widget-body\">"; strDiv += " <div class=\"widget-main\">"; strDiv += " <img src=\"" + OP_Mode.Dtv[i]["ImageName"].ToString() + "\" class=\"img-rounded\" style=\"max-width:90%\" />"; ///说明信息 strDiv += " </div>"; strDiv += " </div>"; strDiv += " </div>"; ////////////// } else { strDiv += " <div class=\"timeline-item clearfix\">"; strDiv += " <div class=\"timeline-info\">"; //if (OP_Mode.Dtv[i]["Remark"].ToString().Length > 0) //{ strDiv += " <i class=\"icon-credit-card bigger-230 green\"></i>"; strDiv += " </div>"; strDiv += " <div class=\"widget-box transparent\">"; strDiv += " <div class=\"widget-header widget-header-small\">"; // strDiv += " <B><span class=\"green\">" + OP_Mode.Dtv[i]["Remark"].ToString() + "</span></B> [<a href=\"BanceAdd.aspx?ID=" + OP_Mode.Dtv[i]["ID"].ToString() + "\">编辑</a>]"; ///消费金额 strDiv += " <B><span class=\"green\">" + OP_Mode.Dtv[i]["Remark"].ToString() + "</span></B> "; ///消费金额 strDiv += " </div>"; //} strDiv += " <div class=\"widget-body\">"; strDiv += " <div class=\"widget-main\">"; strDiv += " <img src=\"" + OP_Mode.Dtv[i]["ImageName"].ToString() + "\" class=\"img-rounded\" style=\"max-width:90%\" />"; ///说明信息 strDiv += " </div>"; strDiv += " </div>"; strDiv += " </div>"; } } if (i == OP_Mode.Dtv.Count - 1) { // 最后一条信息,输出结尾 strDiv += " </div>"; } } if (strDiv.Length > 0) { Div_PhotoList.InnerHtml = strDiv; Div_PhotoList.Visible = true; } else { Div_PhotoList.InnerHtml = String.Empty; Div_PhotoList.Visible = false; } } else { Div_PhotoList.InnerHtml = String.Empty; Div_PhotoList.Visible = false; } } else { MessageBox("", OP_Mode.strErrMsg); return; } }
/// <summary> /// 加载考勤信息 /// </summary> private void LoadQDList() { string strTemp = string.Empty; string strSQL = string.Empty; // strSQL = "Select * from w_kq where userid=" + DefaultUser + " and ctime between '" + System.DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00' and '" + System.DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00' order by ctime desc"; if (GridView_MSG_Label_tj.Text.Length > 0) { strSQL = "Select w_kq.*,CName,HeadUrl from w_kq,S_USERINFO where UserID=S_USERINFO.ID and " + GridView_MSG_Label_tj.Text + " order by CName,w_kq.ctime desc"; if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { for (int i = 0; i < OP_Mode.Dtv.Count; i++) { if (i == 0) { strTemp += " <div class='timeline-label'>"; strTemp += " <span class='label label-primary arrowed-in-right label-lg'>"; strTemp += OP_Mode.Dtv[i]["CName"].ToString(); strTemp += " <b>" + Convert.ToDateTime(OP_Mode.Dtv[i]["CTime"]).ToString("yyyy-MM-dd") + "</b>"; strTemp += " </span>"; strTemp += " </div>"; } else { if (Convert.ToDateTime(OP_Mode.Dtv[i]["CTime"]).ToString("yyyy-MM-dd") != Convert.ToDateTime(OP_Mode.Dtv[i - 1]["CTime"]).ToString("yyyy-MM-dd")) { strTemp += " <div class='timeline-label'>"; strTemp += " <span class='label label-primary arrowed-in-right label-lg'>"; strTemp += OP_Mode.Dtv[i]["CName"].ToString(); strTemp += " <b>" + Convert.ToDateTime(OP_Mode.Dtv[i]["CTime"]).ToString("yyyy-MM-dd") + "</b>"; strTemp += " </span>"; strTemp += " </div>"; } } strTemp += "<div class='timeline-item clearfix'>"; strTemp += " <div class='timeline-info'>"; if (OP_Mode.Dtv[i]["HeadUrl"].ToString().Length > 0) { strTemp += "<img src='" + OP_Mode.Dtv[i]["HeadUrl"].ToString() + "' />"; } strTemp += " <span class='label label-info label-sm'>" + Convert.ToDateTime(OP_Mode.Dtv[i]["CTime"]).ToString("HH:mm") + "</span>"; strTemp += " </div>"; strTemp += " <div class='widget-box transparent'>"; strTemp += " <div class='widget-header widget-header-small'>"; strTemp += " <h5 class='smaller'>"; strTemp += " <span class='grey'><a href='#'>" + OP_Mode.Dtv[i]["ZB_WZ"] + "</a></span>"; strTemp += " </h5>"; strTemp += " <span class='widget-toolbar'>"; strTemp += " <a href='#' data-action='collapse'>"; strTemp += " <i class='icon-chevron-up'></i>"; strTemp += " </a>"; strTemp += " </span>"; strTemp += " </div>"; strTemp += " <div class='widget-body'>"; strTemp += " <div class='widget-main'>"; if (OP_Mode.Dtv[i]["Image1"].ToString().Length > 0) { strTemp += " <a href='/KQImage/" + OP_Mode.Dtv[i]["Image1"].ToString() + "'><img src='/KQImage/" + OP_Mode.Dtv[i]["Image1"].ToString() + "' /></a>"; } if (OP_Mode.Dtv[i]["Image2"].ToString().Length > 0) { strTemp += " <img src='/KQImage/" + OP_Mode.Dtv[i]["Image2"].ToString() + "' />"; } if (OP_Mode.Dtv[i]["Image3"].ToString().Length > 0) { strTemp += " <img src='/KQImage/" + OP_Mode.Dtv[i]["Image3"].ToString() + "' />"; } if (OP_Mode.Dtv[i]["Image4"].ToString().Length > 0) { strTemp += " <img src='/KQImage/" + OP_Mode.Dtv[i]["Image4"].ToString() + "' />"; } if (OP_Mode.Dtv[i]["Image5"].ToString().Length > 0) { strTemp += " <img src='/KQImage/" + OP_Mode.Dtv[i]["Image5"].ToString() + "' />"; } if (OP_Mode.Dtv[i]["Image6"].ToString().Length > 0) { strTemp += " <img src='/KQImage/" + OP_Mode.Dtv[i]["Image6"].ToString() + "' />"; } if (OP_Mode.Dtv[i]["Image7"].ToString().Length > 0) { strTemp += " <img src='/KQImage/" + OP_Mode.Dtv[i]["Image7"].ToString() + "' />"; } if (OP_Mode.Dtv[i]["Image8"].ToString().Length > 0) { strTemp += " <img src='/KQImage/" + OP_Mode.Dtv[i]["Image8"].ToString() + "' />"; } if (OP_Mode.Dtv[i]["Image9"].ToString().Length > 0) { strTemp += " <img src='/KQImage/" + OP_Mode.Dtv[i]["Image9"].ToString() + "' />"; } strTemp += OP_Mode.Dtv[i]["Remark"]; strTemp += " </div>"; strTemp += " </div>"; strTemp += " </div>"; strTemp += " </div>"; } if (strTemp.Length > 0) { QDList.Visible = true; QDList.InnerHtml = strTemp; } } } else { MessageBox("", "错误:" + OP_Mode.strErrMsg); } } else { QDList.Visible = false; } }
/// <summary> /// 数据保存 /// </summary> private void SaveData() { string DB_01 = TextBox_AZWZ.Text; string DB_02 = TextBox_SBBH.Text; string DB_03 = TextBox_SBMC.Text; string DB_04 = TextBox_SBPP.Text; string DB_05 = TextBox_SBXH.Text; string DB_06 = TextBox_JLDW.Text; string DB_07 = TextBox_SL.Text; string DB_08 = TextBox_XQSM.Text; string DB_09 = TextBox_FS.Text; string DB_10 = TextBox_AZFS.Text; if (Label_GCBH.Text.Length != strGCDH.Length) { MessageBox("", "工程单号获取错误,请重试。", "/GDGL/"); return; } //if (DB_01.Length == 0 || DB_02.Length == 0 || DB_03.Length == 0 || DB_04.Length == 0 || DB_05.Length == 0 || DB_06.Length == 0 || DB_07.Length == 0 || DB_08.Length == 0 || DB_09.Length == 0) //{ // MessageBox("", "所有选项都必须填写。<br/>请检查后认真填写。"); // return; //} try { if (Convert.ToInt32(DB_09) < 0) { MessageBox("", "布线分数必须为大于等于0的整数。请重新填写。"); return; } if (Convert.ToInt32(DB_10) < 0) { MessageBox("", "安装分数必须为大于等于0的整数。请重新填写。"); return; } } catch { MessageBox("", "施工分数必须为正整数。请重新填写。"); return; } if (Convert.ToInt32(Request[ID]) > 0) { strSQL = "Insert into W_GCGD2 (GCDH,AZWZ,SBBH,SBMC,SBPP,SBXH,JLDW,SL,YQSM,FS,AZFS) values ('" + Label_GCBH.Text + "','" + DB_01 + "','" + DB_02 + "','" + DB_03 + "','" + DB_04 + "','" + DB_05 + "','" + DB_06 + "'," + DB_07 + ",'" + DB_08 + "'," + DB_09 + "," + DB_10 + ")"; if (OP_Mode.SQLRUN(strSQL)) { MessageBox("", "工程明细添加成功!", "/GDGL/GCGDAdd.ASPX?ID=" + Request["ID"]); return; } else { MessageBox("", "明细添加错误。<br>错误:" + OP_Mode.strErrMsg); } } else if (Convert.ToInt32(Request["MXID"]) > 0) { strSQL = "update W_GCGD2 set AZWZ='" + DB_01 + "',SBBH='" + DB_02 + "',SBMC='" + DB_03 + "',SBPP='" + DB_04 + "',SBXH='" + DB_05 + "',JLDW='" + DB_06 + "',SL='" + DB_07 + "',YQSM='" + DB_08 + "',FS='" + DB_09 + "',AZFS=" + DB_10 + ",LTime=Getdate() WHERE ID=" + Request["MXID"]; strSQL += " Select ID from W_GCGD1 where GCDH='" + Label_GCBH.Text + "'"; if (OP_Mode.SQLRUN(strSQL)) { MessageBox("", "工程明细修改成功!", "/GDGL/GCGDAdd.ASPX?ID=" + OP_Mode.Dtv[0]["ID"].ToString()); return; } else { MessageBox("", "明细修改错误。<br>错误:" + OP_Mode.strErrMsg); } } }
/// <summary> /// 保存数据 /// </summary> private bool SaveData() { bool rValue = false; /// 1、输入判断 string ErrMsg = string.Empty; int i = 0; if (Label_CName.Text != UserNAME) { i = i + 1; ErrMsg += i + "、您只能编辑您自己的单据。<br>"; } if (Label_Flag.Text != "待提交") { i = i + 1; ErrMsg += i + "、已经提交的单据是不允许保存的。<br>"; } if (TextBox_Remark.Text.Length <= 0) { i = i + 1; ErrMsg += i + "、工程编号或事由必须填写。<br>"; } if (Convert.ToInt32(HiddenField1.Value) > 0) { if (iClass(DropDownList1.SelectedValue) != Convert.ToInt32(HiddenField1.Value)) { i = i + 1; ErrMsg += i + "、不同费用类型请不要填写在同一张单据上。<br>"; } } else { HiddenField1.Value = iClass(DropDownList1.SelectedValue).ToString(); // 设置单据类型 } if (ErrMsg.Length == 0) { if (DropDownList1.SelectedValue == "交通费" || DropDownList1.SelectedValue == "运输费") { TCFDD.Visible = true; TDDDD.Visible = true; if (TextBox_Becity.Text.Length <= 0) { i = i + 1; ErrMsg += i + "、出发地点必须填写。<br>"; } if (TextBox_Arrival.Text.Length <= 0) { i = i + 1; ErrMsg += i + "、到达地点必须填写。<br>"; } } else if (DropDownList1.SelectedValue == "补助") { TBreakfirst.Visible = true; TZC.Visible = true; TWC.Visible = true; TZS.Visible = true; TDRZS.Visible = true; if (TextBox_Breakfirst.Text.Length <= 0 && TextBox_ZC.Text.Length <= 0 && TextBox_WC.Text.Length <= 0 && TextBox_ZS.Text.Length <= 0 && TextBox_DRZS.Text.Length <= 0) { i = i + 1; ErrMsg += i + "、早餐、晚餐、住宿或者多人住宿补助至少选填一个。<br>"; } if (TextBox_DRZS.Text.Length > 0 && TextBox_TXR.Text.Length <= 0) { i = i + 1; ErrMsg += i + "、多人住宿必须填写同行人。<br>"; } } else if (DropDownList1.SelectedValue == "采购物资") { TMC.Visible = true; if (TextBox_MC.Text.Length <= 0) { i = i + 1; ErrMsg += i + "、物资名称必须填写。<br>"; } } if (TextBox_Num.Text.Length <= 0) { i = i + 1; ErrMsg += i + "、报销金额必须填写。<br>"; } else { if (Convert.ToDouble(TextBox_Num.Text) <= 0) { i = i + 1; ErrMsg += i + "、报销金额必须大于0。<br>"; } } if (TextBox_Cname.Text.Length <= 0) { i = i + 1; ErrMsg += i + "、收款人必须填写。<br>"; } } if (ErrMsg.Length > 0) { MessageBox("", ErrMsg); rValue = false; } else { rValue = true; } int MXID = 0; try { MXID = Convert.ToInt32(Request["MXID"].Length); } catch { } if (rValue) { String imageName = UploadTP(FileUpload1); String imageName2 = UploadTP(FileUpload2); String imageName3 = UploadTP(FileUpload3); if (imageName.Length > 0 || DropDownList1.SelectedValue == "补助" || DropDownList1.SelectedValue == "办公费" || DropDownList1.SelectedValue == "福利费" || DropDownList1.SelectedValue == "行政综合" || DropDownList1.SelectedValue == "交通费" || MXID > 0) {/// 图片上传成功 string strSQL = string.Empty; int newID = 0; if (Label_No.Text.Length == "BXD2020-12-01-0001".Length) {/// 更新主表数据 strSQL = " Update w_bxd1 set BXLX='" + RadioButtonList1.SelectedValue + "',SKR='" + TextBox_Cname.Text + "',Remark='" + TextBox_Remark.Text.Replace("'", "") + "',LTIME=getdate() where BXDH='" + Label_No.Text + "'"; strSQL += " SELECT * FROM w_bxd1 WHERE BXDH='" + Label_No.Text + "'"; } else {/// 插入数据 //1、插入主表数据 strSQL = " Insert into w_bxd1 (UserName,BXDH,FLAG,BXLX,Remark,skr) values ('" + UserNAME + "',(SELECT 'BXD'+CONVERT(VARCHAR(10),GETDATE(),120) + '-' + RIGHT('0000' + CAST(ISNULL(MAX(RIGHT(BXDH,4)),'0000') + 1 AS VARCHAR),4) FROM w_bxd1 WHERE CONVERT(VARCHAR(10),GETDATE(),120) = CONVERT(VARCHAR(10),CTIME,120)),0," + RadioButtonList1.SelectedValue + ",'" + TextBox_Remark.Text.Replace("'", "") + "','" + TextBox_Cname.Text + "')"; /// 查询主表数据(用来显示新插入的报销单编号 strSQL += " SELECT * FROM w_bxd1 WHERE ID=SCOPE_IDENTITY()"; } /// 运行脚本 if (OP_Mode.SQLRUN(strSQL)) { rValue = true; newID = Convert.ToInt32(OP_Mode.Dtv[0]["ID"]); double db_Bk, Db_ZC, DB_WC, Db_ZS, DB_DRZS; if (TextBox_Breakfirst.Text.Replace("'", "").Length == 0) { db_Bk = 0; } else { db_Bk = Convert.ToDouble(TextBox_Breakfirst.Text.Replace("'", "")); } if (TextBox_ZC.Text.Replace("'", "").Length == 0) { Db_ZC = 0; } else { Db_ZC = Convert.ToDouble(TextBox_ZC.Text.Replace("'", "")); } if (TextBox_WC.Text.Replace("'", "").Length == 0) { DB_WC = 0; } else { DB_WC = Convert.ToDouble(TextBox_WC.Text.Replace("'", "")); } if (TextBox_ZS.Text.Replace("'", "").Length == 0) { Db_ZS = 0; } else { Db_ZS = Convert.ToDouble(TextBox_ZS.Text.Replace("'", "")); } if (TextBox_DRZS.Text.Replace("'", "").Length == 0) { DB_DRZS = 0; } else { DB_DRZS = Convert.ToDouble(TextBox_DRZS.Text.Replace("'", "")); } if (OP_Mode.Dtv.Count > 0) { Label_No.Text = OP_Mode.Dtv[0]["BXDH"].ToString();// 订单号 } if (db_Bk > 0) { // 如果报销餐费补助和住宿补助 则检查是不是本人报销过。 strSQL = "Select * from W_BXD1,W_BXD2 where W_BXD1.bxdh=W_BXD2.BXDH and UserName='******' and Occurrence='" + TextBoxSTime.Text.Replace("'", "") + " 00:00:00.000' and breakfirst>0"; // 查询是否是通行人 if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { MessageBox("", "您当天已经报销过早餐补助了。<br/> 您不能再报销该费用了。"); return(false); } } else { MessageBox("", "明细保存错误。<br/>错误:" + OP_Mode.strErrMsg); return(false); } } if (Db_ZC > 0) { // 如果报销餐费补助和住宿补助 则检查是不是本人报销过。 strSQL = "Select * from W_BXD1,W_BXD2 where W_BXD1.bxdh=W_BXD2.BXDH and UserName='******' and Occurrence='" + TextBoxSTime.Text.Replace("'", "") + " 00:00:00.000' and ZCBZ>0"; // 查询是否是通行人 if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { MessageBox("", "您当天已经报销过午餐补助了。<br/> 您不能再报销该费用了。"); return(false); } } else { MessageBox("", "明细保存错误。<br/>错误:" + OP_Mode.strErrMsg); return(false); } } if (DB_WC > 0) { // 如果报销餐费补助和住宿补助 则检查是不是本人报销过。 strSQL = "Select * from W_BXD1,W_BXD2 where W_BXD1.bxdh=W_BXD2.BXDH and UserName='******' and Occurrence='" + TextBoxSTime.Text.Replace("'", "") + " 00:00:00.000' and WCBZ>0"; // 查询是否是通行人 if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { MessageBox("", "您当天已经报销过晚餐补助了。<br/> 您不能再报销该费用了。"); return(false); } } else { MessageBox("", "明细保存错误。<br/>错误:" + OP_Mode.strErrMsg); return(false); } } if (Db_ZS > 0) { // 如果报销餐费补助和住宿补助 则检查是不是通行人报销过。 strSQL = "Select * from W_BXD2 where TXR='" + UserNAME + "' and Occurrence='" + TextBoxSTime.Text.Replace("'", "") + " 00:00:00.000' "; // 查询是否是通行人 if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { MessageBox("", "您该天被当做同行人报销过该费用了。<br/> 您不能再报销该费用了。"); return(false); } } else { MessageBox("", "明细保存错误。<br/>错误:" + OP_Mode.strErrMsg); return(false); } } string strKZXM, strSTime, strTXR, strMC, strBecity, strArrival, strRemark2; double strNum; strKZXM = DropDownList1.SelectedValue.Replace("'", ""); // 报销项目 strSTime = TextBoxSTime.Text.Replace("'", ""); //报销时间 strTXR = TextBox_TXR.Text.Replace("'", ""); // 同行人 strMC = TextBox_MC.Text.Replace("'", ""); // 名称 strBecity = TextBox_Becity.Text.Replace("'", ""); // 出发地点 strArrival = TextBox_Arrival.Text.Replace("'", ""); //到达地点 if (DropDownList1.SelectedValue == "补助") { strNum = db_Bk + Db_ZC + DB_WC + Db_ZS + DB_DRZS; } else { strNum = Convert.ToDouble(TextBox_Num.Text);// 报销金额 } strRemark2 = TextBox_Remark2.Text.Replace("'", "");//报销说明信息 imageName = "/BxImages/" + imageName; imageName2 = "/BxImages/" + imageName2; imageName3 = "/BxImages/" + imageName3; if (MXID > 0) { strSQL = " update w_bxd2 set KZXM='" + strKZXM + "',"; strSQL += " Occurrence='" + strSTime + "',"; strSQL += " BreakFirst='" + db_Bk + "',"; strSQL += " ZCBZ='" + Db_ZC + "',"; strSQL += " WCBZ='" + DB_WC + "',"; strSQL += " ZSBZ='" + Db_ZS + "',"; strSQL += " DRZS='" + DB_DRZS + "',"; strSQL += " TXR='" + strTXR + "',"; strSQL += " MC='" + strMC + "',"; strSQL += " Becity='" + strBecity + "',"; strSQL += " Arrival='" + strArrival + "',"; strSQL += " BXJE='" + strNum + "',"; strSQL += " Remark='" + strRemark2 + "'"; if (imageName != "/BxImages/") { strSQL += " ,Image='" + imageName + "'"; } if (imageName2 != "/BxImages/") { strSQL += " ,Image2='" + imageName2 + "'"; } if (imageName3 != "/BxImages/") { strSQL += " ,Image3='" + imageName3 + "'"; } strSQL += " Where ID=" + Request["MXID"] + ""; strSQL += " SELECT * FROM w_bxd2 WHERE ID=" + Request["MXID"]; } else { /// 插入明细数据 strSQL = "Insert into w_bxd2 (BXDH,KZXM,Occurrence,BreakFirst,ZCBZ,WCBZ,ZSBZ,DRZS,TXR,MC,Becity,Arrival,BXJE,Remark,Image,Image2,Image3)"; strSQL += " values ('" + Label_No.Text.Replace("'", "") + "','" + strKZXM + "','" + strSTime + "',"; strSQL += " " + db_Bk + "," + Db_ZC + "," + DB_WC + ", "; strSQL += " " + Db_ZS + "," + DB_DRZS + ",'" + strTXR + "',"; strSQL += " '" + strMC + "','" + strBecity + "','" + strArrival + "'," + strNum + ",'" + strRemark2 + "','" + imageName + "','" + imageName2 + "','" + imageName3 + "')"; strSQL += " SELECT * FROM w_bxd2 WHERE ID=SCOPE_IDENTITY()"; } if (OP_Mode.SQLRUN(strSQL)) { if (MXID > 0) { MessageBox("", "明细修改成功。", "/CWGL/ReimbursementAdd.ASPX?ID=" + Request["ID"]); } AddImagesShow(imageName, imageName2, imageName3, strSTime, strKZXM, strTXR, strMC, strBecity, strArrival, strNum, strRemark2, db_Bk, Db_ZC, DB_WC, Db_ZS, DB_DRZS, Convert.ToInt32(OP_Mode.Dtv[0]["ID"]), true); ClearTextbox(); Label_Sumje.Text = (Convert.ToDouble(Label_Sumje.Text) + strNum).ToString(); } else { MessageBox("", "报销单明细保存错误:<br/>" + strSQL + "<br/>" + OP_Mode.strErrMsg); rValue = false; } } else { MessageBox("", "报销单保存错误:<br/>" + strSQL + "<br/>" + OP_Mode.strErrMsg); rValue = false; } } else {// MessageBox("", "必须上传图片信息。"); rValue = false; } } return(rValue); }
/// <summary> /// 加载并绑定课程安排 /// </summary> private void LoadClassList() { string strSQL = string.Empty; string strDiv = string.Empty; strSQL = "Select * from xmfight_classTime order by week,stime"; if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { strDiv = "<div class=\"col-xs-12 col-sm-10 col-sm-offset-1\">"; for (int i = 0; i < OP_Mode.Dtv.Count; i++) { if (i == 0) {// 输出表头 strDiv += "<div class=\"timeline-container\">"; strDiv += " <div class=\"timeline-label\">"; strDiv += " <span class=\"label label-primary arrowed-in-right label-lg\">"; strDiv += " <b>" + NumtoCHWeek(Convert.ToInt32(OP_Mode.Dtv[i]["Week"])).ToString() + "</b>"; strDiv += " </span>"; strDiv += " </div>"; strDiv += " <div class=\"timeline-items\">"; /// 同日循环 strDiv += " <div class=\"timeline-item clearfix\">"; //strDiv += " <div class=\"timeline-info\">"; //if (Convert.ToInt32(Convert.ToDateTime(OP_Mode.Dtv[i]["STime"]).ToString("HH")) < 12) //{ // strDiv += " <h5 class='red'>上 午</h5>"; //} //else //{ // strDiv += " <h5 class='green'>下 午</h5>"; //} //strDiv += " </div>"; strDiv += " <div class=\"widget-box transparent\">"; strDiv += " <div class=\"widget-header widget-header-small\">"; // strDiv += " <B><span class=\"green\">" + OP_Mode.Dtv[i]["Remark"].ToString() + "</span></B> [<a href=\"BanceAdd.aspx?ID=" + OP_Mode.Dtv[i]["ID"].ToString() + "\">编辑</a>]"; ///消费金额 strDiv += " <B><span class=\"green\">" + Convert.ToDateTime(OP_Mode.Dtv[i]["STime"]).ToString("HH:mm") + " - " + Convert.ToDateTime(OP_Mode.Dtv[i]["ETime"]).ToString("HH:mm") + " [" + OP_Mode.Dtv[i]["Teacher"].ToString() + "]</span></B> "; ///消费金额 strDiv += " </div>"; // } //strDiv += " <div class=\"widget-body\">"; //strDiv += " <div class=\"widget-main\">"; //strDiv += " <img src=\"" + OP_Mode.Dtv[i]["HeadImg"].ToString() + "\" class=\"img-rounded\" style=\"max-width:90%\" />"; ///说明信息 //strDiv += " </div>"; //strDiv += " </div>"; strDiv += " </div>"; ////////////// } if (i > 0) { if (OP_Mode.Dtv[i - 1]["Week"].ToString() != OP_Mode.Dtv[i]["Week"].ToString()) { strDiv += " </div>"; /// 上个日期循环结束 strDiv += "<div class=\"timeline-container\">"; strDiv += " <div class=\"timeline-label\">"; strDiv += " <span class=\"label label-primary arrowed-in-right label-lg\">"; strDiv += " <b>" + NumtoCHWeek(Convert.ToInt32(OP_Mode.Dtv[i]["Week"])).ToString() + "</b>"; strDiv += " </span>"; strDiv += " </div>"; strDiv += " <div class=\"timeline-items\">"; /// 同日循环 strDiv += " <div class=\"timeline-item clearfix\">"; //strDiv += " <div class=\"timeline-info\">"; //if (Convert.ToInt32(Convert.ToDateTime(OP_Mode.Dtv[i]["STime"]).ToString("HH")) < 12) //{ // strDiv += " <h5 class='red'>上 午</h5>"; //} //else //{ // strDiv += " <h5 class='green'>下 午</h5>"; //} //strDiv += " </div>"; strDiv += " <div class=\"widget-box transparent\">"; strDiv += " <div class=\"widget-header widget-header-small\">"; // strDiv += " <B><span class=\"green\">" + OP_Mode.Dtv[i]["Remark"].ToString() + "</span></B> [<a href=\"BanceAdd.aspx?ID=" + OP_Mode.Dtv[i]["ID"].ToString() + "\">编辑</a>]"; ///消费金额 strDiv += " <B><span class=\"green\">" + Convert.ToDateTime(OP_Mode.Dtv[i]["STime"]).ToString("HH:mm") + " - " + Convert.ToDateTime(OP_Mode.Dtv[i]["ETime"]).ToString("HH:mm") + " [" + OP_Mode.Dtv[i]["Teacher"].ToString() + "]</span></B> "; strDiv += " </div>"; // } //strDiv += " <div class=\"widget-body\">"; //strDiv += " <div class=\"widget-main\">"; //strDiv += " <img src=\"" + OP_Mode.Dtv[i]["ImageName"].ToString() + "\" class=\"img-rounded\" style=\"max-width:90%\" />"; ///说明信息 //strDiv += " </div>"; //strDiv += " </div>"; strDiv += " </div>"; ////////////// } else { strDiv += " <div class=\"timeline-item clearfix\">"; //strDiv += " <div class=\"timeline-info\">"; //if (Convert.ToInt32(Convert.ToDateTime(OP_Mode.Dtv[i]["STime"]).ToString("HH")) < 12) //{ // strDiv += " <h5 class='red'>上 午</h5>"; //} //else //{ // strDiv += " <h5 class='green'>下 午</h5>"; //} //strDiv += " </div>"; strDiv += " <div class=\"widget-box transparent\">"; strDiv += " <div class=\"widget-header widget-header-small\">"; // strDiv += " <B><span class=\"green\">" + OP_Mode.Dtv[i]["Remark"].ToString() + "</span></B> [<a href=\"BanceAdd.aspx?ID=" + OP_Mode.Dtv[i]["ID"].ToString() + "\">编辑</a>]"; ///消费金额 strDiv += " <B><span class=\"green\">" + Convert.ToDateTime(OP_Mode.Dtv[i]["STime"]).ToString("HH:mm") + " - " + Convert.ToDateTime(OP_Mode.Dtv[i]["ETime"]).ToString("HH:mm") + " [" + OP_Mode.Dtv[i]["Teacher"].ToString() + "]</span></B> "; strDiv += " </div>"; //} //strDiv += " <div class=\"widget-body\">"; //strDiv += " <div class=\"widget-main\">"; //strDiv += " <img src=\"" + OP_Mode.Dtv[i]["ImageName"].ToString() + "\" class=\"img-rounded\" style=\"max-width:90%\" />"; ///说明信息 //strDiv += " </div>"; //strDiv += " </div>"; strDiv += " </div>"; } } if (i == OP_Mode.Dtv.Count - 1) { // 最后一条信息,输出结尾 strDiv += " </div>"; } } if (strDiv.Length > 0) { Div_PhotoList.InnerHtml = strDiv; Div_PhotoList.Visible = true; } else { Div_PhotoList.InnerHtml = String.Empty; Div_PhotoList.Visible = false; } } else { Div_PhotoList.InnerHtml = String.Empty; Div_PhotoList.Visible = false; } } else { MessageBox("", OP_Mode.strErrMsg); return; } }
/// <summary> /// 加载施工人员 /// </summary> /// <param name="iID"></param> private void LoadSGRY(int iID) { if (iID > 0) { /// 施工员和安装员组用户才加载 string strSQL = "SELECT S_USERINFO.ID,' '+CNAME+' '+ISNULL(SSDZ,'')+' ' NAME,(Select count(id) from W_GCGD_USERS where W_GCGD_USERS.USERS=S_USERINFO.ID and GCDID=" + iID + ") Selected from S_USERINFO,S_YH_QXZ where FLAG=0 and S_USERINFO.id=S_YH_QXZ.USERID and QXZID =3 order by cname"; if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { this.Div1.Visible = true; CheckBoxList1.DataTextField = "NAME"; CheckBoxList1.DataValueField = "ID"; CheckBoxList1.DataSource = OP_Mode.Dtv; CheckBoxList1.DataBind(); string arr1 = string.Empty;; for (int i = 0; i < OP_Mode.Dtv.Count; i++) { if (Convert.ToInt32(OP_Mode.Dtv[i]["Selected"]) > 0) { arr1 += OP_Mode.Dtv[i]["ID"] + ","; } } foreach (ListItem lst in this.CheckBoxList1.Items) { string[] arr = arr1.Trim().Split(','); for (int i = 0; i < arr.Length; i++) { if (arr[i].ToString().Equals(lst.Value)) { lst.Selected = true; } } } } else { this.Div1.Visible = false; } } else { MessageBox("", strSQL + " " + OP_Mode.strErrMsg); } /// 施工员和安装员组用户才加载 strSQL = "SELECT S_USERINFO.ID,' '+CNAME+' '+ISNULL(SSDZ,'')+' ' NAME,(Select count(id) from W_GCGD_USERS where W_GCGD_USERS.USERS=S_USERINFO.ID and GCDID=" + iID + ") Selected from S_USERINFO,S_YH_QXZ where FLAG=0 and S_USERINFO.id=S_YH_QXZ.USERID and QXZID =4 order by cname"; if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { this.Div1.Visible = true; CheckBoxList2.DataTextField = "NAME"; CheckBoxList2.DataValueField = "ID"; CheckBoxList2.DataSource = OP_Mode.Dtv; CheckBoxList2.DataBind(); string arr1 = string.Empty;; for (int i = 0; i < OP_Mode.Dtv.Count; i++) { if (Convert.ToInt32(OP_Mode.Dtv[i]["Selected"]) > 0) { arr1 += OP_Mode.Dtv[i]["ID"] + ","; } } foreach (ListItem lst in this.CheckBoxList2.Items) { string[] arr = arr1.Trim().Split(','); for (int i = 0; i < arr.Length; i++) { if (arr[i].ToString().Equals(lst.Value)) { lst.Selected = true; } } } } else { this.Div1.Visible = false; } } else { MessageBox("", strSQL + " " + OP_Mode.strErrMsg); } } }
/// <summary> /// 模块列表读取 /// </summary> private void Load_GridView_WXD() { // 获取GridView排序数据列及排序方向 string sortExpression = this.GridView_WXD.Attributes["SortExpression"]; string sortDirection = this.GridView_WXD.Attributes["SortDirection"]; string strSQL; if (!QXBool(36, Convert.ToInt32(DefaultUser))) { if (this.GridView_WXD_Label_tj.Text.Length > 0) { strSQL = "SELECT w_wxd.*,CNAME FROM w_wxd,S_USERINFO where wxry=s_userinfo.id and wxry=" + DefaultUser + " and " + this.GridView_WXD_Label_tj.Text.Trim() + " and del=0 ORDER BY ltime desc"; } else { strSQL = "SELECT w_wxd.*,CNAME FROM w_wxd,S_USERINFO where wxry=s_userinfo.id and wxry=" + DefaultUser + " and del=0 ORDER BY ltime desc"; } } else { if (this.GridView_WXD_Label_tj.Text.Length > 0) { strSQL = "SELECT w_wxd.*,CNAME FROM w_wxd,S_USERINFO where wxry=s_userinfo.id and " + this.GridView_WXD_Label_tj.Text.Trim() + " and del=0 ORDER BY ltime desc"; } else { strSQL = "SELECT w_wxd.*,CNAME FROM w_wxd,S_USERINFO where wxry=s_userinfo.id and del=0 ORDER BY ltime desc"; } } if (OP_Mode.SQLRUN(strSQL)) { /// 设置排序 if ((!string.IsNullOrEmpty(sortExpression)) && (!string.IsNullOrEmpty(sortDirection))) { OP_Mode.Dtv.Sort = string.Format("{0} {1}", sortExpression, sortDirection); } /// 设置翻页层始终显示 if (OP_Mode.Dtv.Count == 0) { OP_Mode.Dtv.AddNew(); } this.GridView_WXD.DataSource = OP_Mode.Dtv; this.GridView_WXD.DataBind(); } else { MessageBox("", strSQL + "<br/>" + OP_Mode.strErrMsg); return; } }
/// <summary> /// 模块列表读取 /// </summary> private void Load_GridView_Class() { // 获取GridView排序数据列及排序方向 string sortExpression = this.GridView_Class.Attributes["SortExpression"]; string sortDirection = this.GridView_Class.Attributes["SortDirection"]; string strSQL; if (this.GridView_Class_Label_tj.Text.Length > 0) { strSQL = "SELECT * FROM Dance_Class where " + this.GridView_Class_Label_tj.Text.Trim() + " ORDER BY ID"; } else { strSQL = "Select ID,classname,Flag,PX,school,ClassTeacher,CONVERT(varchar(100), ClassTimeStart, 24) STime,CONVERT(varchar(100), ClassTimeEnd, 24) ETime,ClassWeek,MaxMen,(Select Count(ID) from Dance_Arrange where classID=Dance_Class.ID) ArrAngeCount from Dance_Class where Flag=0 order by PX,ClassTimeStart"; } if (OP_Mode.SQLRUN(strSQL)) { /// 设置排序 if ((!string.IsNullOrEmpty(sortExpression)) && (!string.IsNullOrEmpty(sortDirection))) { OP_Mode.Dtv.Sort = string.Format("{0} {1}", sortExpression, sortDirection); } /// 设置翻页层始终显示 if (OP_Mode.Dtv.Count == 0) { OP_Mode.Dtv.AddNew(); } this.GridView_Class.DataSource = OP_Mode.Dtv; this.GridView_Class.DataBind(); this.GridView_Class.BottomPagerRow.Visible = true; } else { MessageBox("", strSQL + "<br/>" + OP_Mode.strErrMsg); return; } }
/// <summary> /// 模块数据保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView_Class_LinkButton1_Click(object sender, EventArgs e) { /// 课程名 string DB_01 = this.GridView_Class_TextBox_ClassName.Text.Trim().Replace("'", "\""); /// 老师 string DB_02 = this.GridView_Class_TextBox_ClassTeacher.Text.Trim().Replace("'", "\""); /// 开始时间 string DB_03 = this.GridView_Class_TextBox_ClassTimeStart.Text.Trim().Replace("'", "\""); /// 结束时间 string DB_04 = this.GridView_Class_TextBox_ClassTimeEnd.Text.Trim().Replace("'", "\""); /// 星期 string DB_05 = this.GridView_Class_TextBox_ClassWeek.Text.Trim().Replace("'", "\""); /// 最多人数 string DB_06 = this.GridView_Class_TextBox_MaxMen.Text.Trim().Replace("'", "\""); /// 状态 string DB_07 = this.GridView_Class_TextBox_Flag.Text.Trim().Replace("'", "\""); /// 排序 string DB_08 = this.GridView_Class_TextBox_PX.Text.Trim().Replace("'", "\""); /// 学校 string DB_09 = this.GridView_Class_TextBox_School.Text.Trim().Replace("'", "\""); if (!(DB_01.Length > 0)) { MessageBox("", "登录名称不允许为空!<br/>请认真填写。"); return; } string strSQL; strSQL = "Insert into Dance_Class ( ClassName, ClassTeacher, ClassTimeStart, ClassTimeEnd, ClassWeek, MaxMen, Flag, PX, School,CTIME,LTIME) VALUES ('" + DB_01 + "','" + DB_02 + "','" + DB_03 + "','" + DB_04 + "','" + DB_05 + "','" + DB_06 + "','" + DB_07 + "','" + DB_08 + "','" + DB_09 + "',GETDATE(),GETDATE()) "; if (OP_Mode.SQLRUN(strSQL)) { MessageBox("", "课程管理信息添加成功!", Request.Url.LocalPath); } else { MessageBox("", "课程管理信息添加失败!<br/>错误:" + OP_Mode.strErrMsg); return; } Load_GridView_Class(); }
/// <summary> /// 保存考勤数据 /// </summary> private void SaveData() { string Image1 = UploadTP(FileUpload_TP); //string Image2 = UploadTP(FileUpload_TP2); //string Image3 = UploadTP(FileUpload_TP3); //string Image4 = UploadTP(FileUpload_TP4); //string Image5 = UploadTP(FileUpload_TP5); //string Image6 = UploadTP(FileUpload_TP6); //string Image7 = UploadTP(FileUpload_TP7); //string Image8 = UploadTP(FileUpload_TP8); //string Image9 = UploadTP(FileUpload_TP9); string Image2 = string.Empty; string Image3 = string.Empty; string Image4 = string.Empty; string Image5 = string.Empty; string Image6 = string.Empty; string Image7 = string.Empty; string Image8 = string.Empty; string Image9 = string.Empty; string strRemark = TextBox_Remark.Text.Replace("'", "\""); if (Image1.Length > 0) { string strSQL = "Insert into w_KQ (UserID,ZB_JD,ZB_WD,ZB_WZ,Image1,Image2,Image3,Image4,Image5,Image6,Image7,Image8,Image9,Remark) values (" + DefaultUser + ",'" + TextBox_JD.Text + "','" + TextBox_WD.Text + "','" + TextBox_WZ.Text + "','" + Image1 + "','" + Image2 + "','" + Image3 + "','" + Image4 + "','" + Image5 + "','" + Image6 + "','" + Image7 + "','" + Image8 + "','" + Image9 + "','" + strRemark + "')"; if (!OP_Mode.SQLRUN(strSQL)) {//失败,则删除上传的图片 if (File.Exists(Server.MapPath("\\KQImage\\" + Image1))) { File.Delete(Server.MapPath("\\KQImage\\" + Image1)); } if (File.Exists(Server.MapPath("\\KQImage\\" + Image2))) { File.Delete(Server.MapPath("\\KQImage\\" + Image2)); } if (File.Exists(Server.MapPath("\\KQImage\\" + Image3))) { File.Delete(Server.MapPath("\\KQImage\\" + Image3)); } if (File.Exists(Server.MapPath("\\KQImage\\" + Image4))) { File.Delete(Server.MapPath("\\KQImage\\" + Image4)); } if (File.Exists(Server.MapPath("\\KQImage\\" + Image5))) { File.Delete(Server.MapPath("\\KQImage\\" + Image5)); } if (File.Exists(Server.MapPath("\\KQImage\\" + Image6))) { File.Delete(Server.MapPath("\\KQImage\\" + Image6)); } if (File.Exists(Server.MapPath("\\KQImage\\" + Image7))) { File.Delete(Server.MapPath("\\KQImage\\" + Image7)); } if (File.Exists(Server.MapPath("\\KQImage\\" + Image8))) { File.Delete(Server.MapPath("\\KQImage\\" + Image8)); } if (File.Exists(Server.MapPath("\\KQImage\\" + Image9))) { File.Delete(Server.MapPath("\\KQImage\\" + Image9)); } MessageBox("", "签到失败,请重试!" + OP_Mode.strErrMsg); } else { MessageBox("", "签到成功。", "/"); } } else { MessageBox("", "请拍摄一张照片。"); } }
/// <summary> /// 模块列表读取 /// </summary> private void Load_GridView1() { string strsql = string.Empty; string strTJ = string.Empty; string Db_01 = TextBox_Name.Text.Trim().Replace("'", "''"); string Db_02 = TextBox_DHHM.Text.Trim().Replace("'", "''"); string Db_03 = TextBox_ZJHM.Text.Trim().Replace("'", "''"); string Db_04 = TextBox_XZ.Text.Trim().Replace("'", "''"); string Db_05 = TextBox_SQ.Text.Trim().Replace("'", "''"); string Db_06 = TextBox_XQ.Text.Trim().Replace("'", "''"); string Db_07 = TextBox_JZ.Text.Trim().Replace("'", "''"); if (Db_01.Length > 0) { strTJ += " Name like '%" + Db_01 + "%' "; } if (Db_02.Length > 0) { if (strTJ.Length > 0) { strTJ += " and LXDH like '%" + Db_02 + "%' "; } else { strTJ += " LXDH like '%" + Db_02 + "%' "; } } if (Db_03.Length > 0) { if (strTJ.Length > 0) { strTJ += " and ZJHM like '%" + Db_03 + "%' "; } else { strTJ += " ZJHM like '%" + Db_03 + "%' "; } } if (Db_04.Length > 0) { if (strTJ.Length > 0) { strTJ += " and XZ like '%" + Db_04 + "%' "; } else { strTJ += " XZ like '%" + Db_04 + "%' "; } } if (Db_05.Length > 0) { if (strTJ.Length > 0) { strTJ += " and SQM like '%" + Db_05 + "%' "; } else { strTJ += " SQM like '%" + Db_05 + "%' "; } } if (Db_06.Length > 0) { if (strTJ.Length > 0) { strTJ += " and XQM like '%" + Db_06 + "%' "; } else { strTJ += " XQM like '%" + Db_06 + "%' "; } } if (Db_07.Length > 0) { if (strTJ.Length > 0) { strTJ += " and JZJC like '%" + Db_07 + "%' "; } else { strTJ += " JZJC like '%" + Db_07 + "%' "; } } if (strTJ.Length > 0) { strsql = " Select * from Question_Info where " + strTJ + " order by Name"; if (OP_Mode.SQLRUN(strsql)) { /// 设置排序 if (OP_Mode.Dtv.Count == 0) { this.GridView1.DataSource = null; this.GridView1.DataBind(); Button2.Visible = false;// 设置数据导出按钮隐藏 MessageBox("", "依据条件未查询到任何信息,请简化条件后重试。"); } else { string sortExpression = this.GridView1.Attributes["SortExpression"]; string sortDirection = this.GridView1.Attributes["SortDirection"]; if ((!string.IsNullOrEmpty(sortExpression)) && (!string.IsNullOrEmpty(sortDirection))) { OP_Mode.Dtv.Sort = string.Format("{0} {1}", sortExpression, sortDirection); } this.GridView1.DataSource = OP_Mode.Dtv; this.GridView1.DataBind(); Button2.Visible = true;// 设置数据导出按钮显示出来 Label lab_SumCount = (Label)GridView1.BottomPagerRow.FindControl("Label_SumCount"); lab_SumCount.Text = OP_Mode.Dtv.Count.ToString(); } } } else { MessageBox("", "请任意输入一个查询条件。"); } }
/// <summary> /// 模块数据保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView_JG_LinkButton1_Click(object sender, EventArgs e) { /// 机构全称 string DB_01 = this.GridView_JG_TextBox_JGQC.Text.Trim().Replace("'", "\""); /// 机构简称 string DB_02 = this.GridView_JG_TextBox_JGJC.Text.Trim().Replace("'", "\""); /// LOGO string DB_03 = this.GridView_JG_TextBox_LOGO.Text.Trim().Replace("'", "\""); /// 联系电话 string DB_04 = this.GridView_JG_TextBox_LXDH.Text.Trim().Replace("'", "\""); string DB_05 = this.GridView_JG_TextBox_JGJJ.Text.Trim().Replace("'", "\""); if (!(DB_01.Length > 0)) { MessageBox("", "机构全称不允许为空!<br/>请认真填写。"); return; } if (!(DB_02.Length > 0)) { MessageBox("", "机构简称不允许为空!<br/>请认真填写。"); return; } if (!(DB_04.Length > 0)) { MessageBox("", "机构联系电话不允许为空!<br/>请认真填写。"); return; } string strSQL; strSQL = "Insert into S_JG ( JGQC, JGJC, LOGO, LXDH, JGJJ,CTIME,LTIME) VALUES ('" + DB_01 + "','" + DB_02 + "','" + DB_03 + "','" + DB_04 + "','" + DB_05 + "',GETDATE(),GETDATE()) "; if (OP_Mode.SQLRUN(strSQL)) { MessageBox("", "教育机构信息添加成功!", Request.Url.LocalPath); } else { MessageBox("", "教育机构信息添加失败!<br/>错误:" + OP_Mode.strErrMsg); return; } Load_GridView_JG(); }
/// <summary> /// 待审核机构数据读取 /// </summary> private void Load_GridView_JG() { // 获取GridView排序数据列及排序方向 string sortExpression = this.GridView_JG.Attributes["SortExpression"]; string sortDirection = this.GridView_JG.Attributes["SortDirection"]; string strSQL; if (this.GridView_JG_Label_tj.Text.Length > 0) { strSQL = "SELECT * FROM S_JG where " + this.GridView_JG_Label_tj.Text.Trim() + " and del=0 and Flag=0 ORDER BY ID"; } else { strSQL = "SELECT * FROM S_JG where del=0 and Flag=0 ORDER BY ID"; } if (OP_Mode.SQLRUN(strSQL)) { /// 设置排序 if ((!string.IsNullOrEmpty(sortExpression)) && (!string.IsNullOrEmpty(sortDirection))) { OP_Mode.Dtv.Sort = string.Format("{0} {1}", sortExpression, sortDirection); } /// 设置翻页层始终显示 if (OP_Mode.Dtv.Count == 0) { OP_Mode.Dtv.AddNew(); } this.GridView_JG.DataSource = OP_Mode.Dtv; this.GridView_JG.DataBind(); this.GridView_JG.BottomPagerRow.Visible = true; } else { MessageBox("", strSQL + "<br/>" + OP_Mode.strErrMsg); return; } }
private void LoadStudents() { string strTempDiv = string.Empty; string strSQL;//= "Select ID,Name,Sex,Remark,Tel,BrithDay,datediff(year, BrithDay,getdate()) age,HeadImg from XMFight_Student order by Name"; strSQL = " Select ID, Name, Sex, Remark, Tel, BrithDay, datediff(year, BrithDay, getdate()) age,HeadImg"; strSQL += " ,sumClassCount,LastClassTime,"; strSQL += " isnull((Select Count(ID) from XMFight_Class_Record where IFlag=2 and StudentID = a.ID),0) Leave,"; strSQL += " isnull((Select Count(ID) from XMFight_Class_Record where IFlag=3 and StudentID = a.ID),0) Absenteeism,"; strSQL += " isnull((Select sum(Bance) from XMFight_reserve where StudentID=a.ID),0) SumBance"; strSQL += " from XMFight_Student a,"; strSQL += " (Select sum(ICount) sumClassCount, MAX(CTime) LastClassTime, StudentID from XMFight_Class_Record group by StudentID) as b"; strSQL += " where a.ID = b.StudentID"; if (TextBox1.Text.Length > 0) { strSQL += " and a.name like '%" + TextBox1.Text.Replace("'", "''") + "%' "; } strSQL += " order by Name"; if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { for (int i = 0; i < OP_Mode.Dtv.Count; i++) { strTempDiv += "<div class=\"itemdiv dialogdiv\">"; strTempDiv += "<div class=\"user\">"; if (OP_Mode.Dtv[i]["HeadImg"].ToString().Length < 10) {// 显示头像 strTempDiv += " <img src=\"/images/XMFightLogo.jpg\"/>"; } else { strTempDiv += " <img src=\"" + OP_Mode.Dtv[i]["HeadImg"].ToString() + "\"/>"; } strTempDiv += "</div>"; strTempDiv += "<div class=\"body\">"; strTempDiv += " <div class=\"time\">"; strTempDiv += " <i class=\"icon-time\"></i>"; strTempDiv += " <span class=\"green\">" + Convert.ToDateTime(OP_Mode.Dtv[i]["Brithday"]).ToString("yyyy-MM-dd") + "</span>"; strTempDiv += " </div>"; strTempDiv += " <div class=\"name\">"; if (Convert.ToInt32(OP_Mode.Dtv[i]["sex"]) == 1) {/// 1 是男生 strTempDiv += " <a href=\"tel:" + OP_Mode.Dtv[i]["Tel"].ToString() + "\"> " + OP_Mode.Dtv[i]["Name"].ToString() + " <span class=\"label label-info arrowed-in arrowed-in-right\"> " + OP_Mode.Dtv[i]["age"].ToString() + " 岁 </span> </a>"; } else { strTempDiv += " <a href=\"tel:" + OP_Mode.Dtv[i]["Tel"].ToString() + "\"> " + OP_Mode.Dtv[i]["Name"].ToString() + " <span class=\"label label-danger arrowed-in arrowed-in-right\"> " + OP_Mode.Dtv[i]["age"].ToString() + " 岁 </span> </a>"; } strTempDiv += " </div>"; strTempDiv += " <div class=\"text\">"; if (ExecDateDiff(Convert.ToDateTime(OP_Mode.Dtv[i]["LastClassTime"]), System.DateTime.Now) > 7) {/// 超过 7 天未上课的 红色显示 strTempDiv += " <h5>上节课时间:<span class=\"label label-danger\">" + Convert.ToDateTime(OP_Mode.Dtv[i]["LastClassTime"]).ToString("yyyy-MM-dd") + " </span></h5>"; } else { strTempDiv += " <h5>上节课时间:" + Convert.ToDateTime(OP_Mode.Dtv[i]["LastClassTime"]).ToString("yyyy-MM-dd") + " </h5>"; } if (Convert.ToDouble(OP_Mode.Dtv[i]["sumClassCount"]) < 11) {/// 小于 11 节课,高亮显示 strTempDiv += " <h5>剩余课时:<span class=\"label label-danger\">" + OP_Mode.Dtv[i]["sumClassCount"].ToString() + "</span> 节</h5>"; } else { strTempDiv += " <h5>剩余课时:" + OP_Mode.Dtv[i]["sumClassCount"].ToString() + " 节</h5>"; } if (Convert.ToDouble(OP_Mode.Dtv[i]["Leave"]) > 5) {/// 请假超过 5 节课,高亮显示 strTempDiv += " <h5>请假:<span class=\"label label-danger\">" + OP_Mode.Dtv[i]["Leave"].ToString() + "</span> 节</h5>"; } else { strTempDiv += " <h5>请假:" + OP_Mode.Dtv[i]["Leave"].ToString() + " 节</h5>"; } if (Convert.ToDouble(OP_Mode.Dtv[i]["Absenteeism"]) > 2) {/// 请假超过 2 节课,高亮显示 strTempDiv += " <h5>旷课:<span class=\"label label-danger\">" + OP_Mode.Dtv[i]["Absenteeism"].ToString() + "</span> 节</h5>"; } else { strTempDiv += " <h5>旷课:" + OP_Mode.Dtv[i]["Absenteeism"].ToString() + " 节</h5>"; } strTempDiv += " <h5 class='pink'>储备金:" + OP_Mode.Dtv[i]["SumBance"].ToString() + " 元</h5>"; if (OP_Mode.Dtv[i]["Remark"].ToString().Length > 0) { strTempDiv += "<h5 class='red'>备注:" + OP_Mode.Dtv[i]["Remark"].ToString() + "</h5> "; } strTempDiv += " </div>"; strTempDiv += " <div class=\"tools\">"; strTempDiv += " <a href=\"Operation.aspx?SID=" + OP_Mode.Dtv[i]["ID"].ToString() + "&CID=1\" class=\"btn btn-minier btn-success\">上课"; strTempDiv += " </a>"; strTempDiv += " <a href=\"Operation.aspx?SID=" + OP_Mode.Dtv[i]["ID"].ToString() + "&CID=2\" class=\"btn btn-minier btn-info\">请假"; strTempDiv += " </a>"; strTempDiv += " <a href=\"Operation.aspx?SID=" + OP_Mode.Dtv[i]["ID"].ToString() + "&CID=3\" class=\"btn btn-minier btn-danger\">旷课"; strTempDiv += " </a>"; strTempDiv += " <a href=\"Operation.aspx?SID=" + OP_Mode.Dtv[i]["ID"].ToString() + "&CID=0\" class=\"btn btn-minier btn-pink\">储备金"; strTempDiv += " </a>"; strTempDiv += " </div>"; strTempDiv += " </div>"; strTempDiv += " </div>"; } if (strTempDiv.Length > 0) { Div_StudentsList.InnerHtml = strTempDiv; } } } }
private string LoadStudent() { string rValue = string.Empty; string strSQL = string.Empty; if (Request.QueryString["ClassID"] != null && Request.QueryString["ClassID"] != "") { strSQL = "SELECT S_XS.CNAME,S_XS.XB,S_XS.ID,S_BJ.BJMC FROM S_XS,S_BJ WHERE S_XS.CLASSID = S_BJ.ID AND S_XS.DEL = 0 AND S_XS.CLASSID = " + Request.QueryString["ClassID"] + " ORDER BY S_XS.CNAME"; if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { Label1.Text = OP_Mode.Dtv[0]["BJMC"].ToString(); for (int i = 0; i < OP_Mode.Dtv.Count; i++) { if (OP_Mode.Dtv[i]["XB"].ToString() == "0") {// 0 表示男生,蓝色 rValue += " <div class=\"infobox infobox-blue\">"; } else {// 非0 则表示女生,红色 rValue += " <div class=\"infobox infobox-red\">"; } rValue += " <div class=\"infobox-icon\">"; rValue += " <i class=\"icon-group\"></i>"; rValue += " </div>"; rValue += " <div class=\"infobox-data\">"; rValue += " <span class=\"infobox-data-number\">" + OP_Mode.Dtv[i]["CNAME"].ToString() + "(10/18)</span>"; rValue += " <div class=\"infobox-content\">"; rValue += " <div class=\"infobox-content\"><a href=\"#\"><i class=\"icon-calendar\"></i> 签到</a><a href=\"#\"> <i class=\"icon-camera\"></i> 点评</a><a href=\"#\"> <i class=\"icon-edit\"></i> 编辑</a></div>"; rValue += " </div>"; rValue += " </div>"; rValue += " </div>"; } } else { rValue += " <div class=\"infobox infobox-red\">"; rValue += " <div class=\"infobox-icon\">"; rValue += " <i class=\"icon-bolt\"></i>"; rValue += " </div>"; rValue += " <div class=\"infobox-data\">"; rValue += " <span class=\"infobox-data-number\">还没有学生</span>"; //rValue += " <div class=\"infobox-content\">"; //rValue += " <a href=\"/JYJG/Student.aspx?ClassID=" + OP_Mode.Dtv[i]["ID"].ToString() + "\">55 人</a> 陈老师 <a href=\"/JYJG/ClassEdit.aspx?ID=" + OP_Mode.Dtv[i]["ID"].ToString() + "\"><i class=\"icon-edit\"></i></a>"; //rValue += " </div>"; rValue += " </div>"; rValue += " </div>"; } } else { MessageBox("", "参数错误。", "/JYJG/Class.ASPX"); } } else { MessageBox("", "参数错误。", "/JYJG/Class.ASPX"); } return(rValue); }
/// <summary> /// 提交状态 /// </summary> private void SaveFlag() { if (Label_No.Text.Length < 18) {/// 单据编号不对,不允许提交 return; } // 保存记录表 W_Examine int oldFlag = NameToFlag(Label_Flag.Text); // 当前状态 int NewFlag = NextFlag(oldFlag); // 提交后他状态 if (Label_Flag.Text == "综合部") { if (!QXBool(39, Convert.ToInt32(DefaultUser))) { MessageBox("", "您没有审核的权限。", Defaut_QX_URL); return; } } else if (Label_Flag.Text == "物资部") { if (!QXBool(40, Convert.ToInt32(DefaultUser))) { MessageBox("", "您没有审核的权限。", Defaut_QX_URL); return; } } else if (Label_Flag.Text == "工程部") { if (!QXBool(41, Convert.ToInt32(DefaultUser))) { MessageBox("", "您没有审核的权限。", Defaut_QX_URL); return; } } else if (Label_Flag.Text == "待放款" || Label_Flag.Text == "待收票" || Label_Flag.Text == "财务部") { if (!QXBool(42, Convert.ToInt32(DefaultUser))) { MessageBox("", "您没有审核的权限。", Defaut_QX_URL); return; } } else if (Label_Flag.Text == "待提交") { if (UserNAME != Label_CName.Text) { MessageBox("", "您不允许提交别人的单据。"); return; } } string strSQL = " Insert into W_Examine(Class,DJBH,UserName,OldFlag,NewFlag) values ('BXD','" + Label_No.Text + "','" + UserNAME + "'," + oldFlag + "," + NewFlag + ")"; if (Label_Flag.Text == "待提交") { strSQL += " Update W_BXD1 Set Flag=" + NewFlag + ",SKR='" + TextBox_Cname.Text + "',Remark='" + TextBox_Remark.Text + "',LTime=getdate() where BXDH='" + Label_No.Text + "'"; } else { strSQL += " Update W_BXD1 Set Flag=" + NewFlag + ",LTime=getdate() where BXDH='" + Label_No.Text + "'"; } if (OP_Mode.SQLRUN(strSQL)) { if (NewFlag == 2) {//综合部 SedMsg(11); } else if (NewFlag == 3) {//物资部 SedMsg(12); } else if (NewFlag == 4) {//工程部 SedMsg(2); } else if (NewFlag == 5) {//财务部 SedMsg(10); } else if (NewFlag == 6) {//待放款 SedMsg(10); } else if (NewFlag == 7) {// 待收票 SedMsg(10); } MessageBox("", "单据提交成功。", "/CWGL/"); } else { MessageBox("", "单据提交失败。<br>错误:" + OP_Mode.strErrMsg); return; } }
/// <summary> /// /// </summary> private void LoadData() { string strSQL = "Select *,w_gcgd2.id IID from W_GCGD_USERS,W_GCGD1,w_gcgd2,S_YH_QXZ where USERS=" + DefaultUser + " and W_GCGD1.GCDH=W_GCGD2.GCDH and W_GCGD1.ID=GCDID and w_gcgd2.id=" + Request["ID"] + " and W_GCGD_USERS.USERS=USERID and QXZID=3 ORDER BY GCDD,AZWZ,SBBH"; int sumSL = 0; ///统计总共完成了多少; bool bUser = false; /// 包含了本人干的活 if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { Label_GCMC.Text = OP_Mode.Dtv[0]["GCMC"].ToString(); Label_GCMC.NavigateUrl = "\\GDGL\\GCBXList.ASPX?ID=" + OP_Mode.Dtv[0]["IID"].ToString(); Label1.Text = OP_Mode.Dtv[0]["AZWZ"].ToString(); Label2.Text = OP_Mode.Dtv[0]["SBBH"].ToString(); Label3.Text = OP_Mode.Dtv[0]["SBMC"].ToString(); Label4.Text = OP_Mode.Dtv[0]["SBPP"].ToString(); Label5.Text = OP_Mode.Dtv[0]["SBXH"].ToString(); Label6.Text = OP_Mode.Dtv[0]["JLDW"].ToString(); Label7.Text = OP_Mode.Dtv[0]["SL"].ToString(); Label8.Text = OP_Mode.Dtv[0]["YQSM"].ToString(); Label9.Text = OP_Mode.Dtv[0]["FS"].ToString(); // TextBox2.Text= OP_Mode.Dtv[0]["XH"].ToString(); /// 加载已经安装的人员 strSQL = "Select CNAME,FS,AZFS,S_USERINFO.ID,Remark,XH,W_GCGD_FS.ID FSID from W_GCGD_FS,S_USERINFO where GCMXID=" + Request["ID"] + " and S_USERINFO.ID=W_GCGD_FS.USERID"; if (OP_Mode.SQLRUN(strSQL)) { string strTemp = string.Empty; for (int i = 0; i < OP_Mode.Dtv.Count; i++) { sumSL += Convert.ToInt16(OP_Mode.Dtv[i]["FS"]); if (Convert.ToInt16(OP_Mode.Dtv[i]["ID"]) == Convert.ToInt16(DefaultUser)) {/// 如果是本用户,则绑定文本框的值 TextBox1.Text = OP_Mode.Dtv[i]["FS"].ToString(); TextBox_Remark.Text = OP_Mode.Dtv[i]["Remark"].ToString(); TextBox2.Text = OP_Mode.Dtv[i]["XH"].ToString(); bUser = true; } strTemp += OP_Mode.Dtv[i]["CNAME"].ToString() + ": 布线【" + OP_Mode.Dtv[i]["FS"].ToString() + " %】<a href='GCBXDel.aspx?ID=" + OP_Mode.Dtv[i]["FSID"].ToString() + "'>删除</a>"; if (Convert.ToDouble(OP_Mode.Dtv[i]["XH"]) > 0) { strTemp += "消耗【" + OP_Mode.Dtv[i]["XH"].ToString() + " 米】"; } strTemp += "<br/>"; } if (strTemp.Length > 0) { Label10.Text = "<br/>" + strTemp; } } if (bUser == false) { /// 如果积分>0 并且 自己没有干过活,则把剩下的赋值给文本框 if (sumSL > 0) { /// 超过0分才设置默认值,否则不设置默认值。 TextBox1.Text = (100 - sumSL).ToString(); } HiddenField_SYFS.Value = (100 - sumSL).ToString();// 记录剩余分数百分比 } else { HiddenField_SYFS.Value = (100 - sumSL + Convert.ToInt32(TextBox1.Text)).ToString(); } } } }
/// <summary> /// 加载基础数据 /// </summary> private void LoadDefaultData() { TextBoxSTime.Text = System.DateTime.Now.ToString("yyyy-MM-dd"); try { int IID = Convert.ToInt32(Request["ID"]); if (IID > 0) { string strSQL = "Select UserName,BXLX,SKR,(Select sum(BXJE) from W_BXD2 where BXDH=W_BXD1.BXDH ) ZJE,W_BXD1.Remark RemarkSum,W_BXD1.FLAG,(Select top 1 Remark from w_examine where djbh=W_BXD1.BXDH and ireturn<>0 order by ltime desc) ReturnMSG,W_BXD2.* from w_BXD1,W_BXD2 where W_BXD1.BXDH=W_BXD2.BXDH and W_BXD1.id=" + IID; if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { bool bDel = true; Label_No.Text = OP_Mode.Dtv[0]["BXDH"].ToString(); TextBox_Remark.Text = OP_Mode.Dtv[0]["RemarkSum"].ToString(); TextBox_Cname.Text = OP_Mode.Dtv[0]["SKR"].ToString(); if (OP_Mode.Dtv[0]["ReturnMSG"].ToString().Length > 0) { /// 被退回单据 ReturnMsg.InnerHtml += " <div class=\"well\">"; ReturnMsg.InnerHtml += " <h4 class=\"red smaller lighter\">单据被退回</h4>"; ReturnMsg.InnerHtml += " <h2>" + OP_Mode.Dtv[0]["ReturnMSG"].ToString() + "</h2>"; ReturnMsg.InnerHtml += " </div>"; } Label_Flag.Text = FlagToName(Convert.ToInt32(OP_Mode.Dtv[0]["FLAG"])); if (Convert.ToInt32(OP_Mode.Dtv[0]["FLAG"]) > 0) { TextBox_Remark.Enabled = false; } else { TextBox_Remark.Enabled = true; } if (OP_Mode.Dtv[0]["FLAG"].ToString() == "0") { Label_Flag.ForeColor = Color.Green; } else if (OP_Mode.Dtv[0]["FLAG"].ToString() == "1") { bDel = false; Label_Flag.ForeColor = Color.Red; } else { bDel = false; } RadioButtonList1.SelectedValue = OP_Mode.Dtv[0]["BXLX"].ToString(); RadioChanged(); Label_CName.Text = OP_Mode.Dtv[0]["UserName"].ToString(); Label_Sumje.Text = OP_Mode.Dtv[0]["ZJE"].ToString(); //if (Convert.ToDouble(OP_Mode.Dtv[0]["ZJE"]) > 0) //{/// 总金额大于0 也允许修改报销类型。 // RadioButtonList1.Enabled = false; // //TextBox_Remark.Enabled = false; //} HiddenField1.Value = iClass(OP_Mode.Dtv[0]["KZXM"].ToString()).ToString(); // 设置单据类型 // 生成明细 for (int i = 0; i < OP_Mode.Dtv.Count; i++) { if (OP_Mode.Dtv[i]["ID"].ToString() == Request["MXID"]) { DropDownList1.SelectedValue = OP_Mode.Dtv[i]["KZXM"].ToString(); TextBoxSTime.Text = Convert.ToDateTime(OP_Mode.Dtv[i]["Occurrence"]).ToString("yyyy-MM-dd"); if (OP_Mode.Dtv[i]["BreakFirst"].ToString() != "0.00") { TextBox_Breakfirst.Text = OP_Mode.Dtv[i]["BreakFirst"].ToString(); } if (OP_Mode.Dtv[i]["ZCBZ"].ToString() != "0.00") { TextBox_ZC.Text = OP_Mode.Dtv[i]["ZCBZ"].ToString(); } if (OP_Mode.Dtv[i]["WCBZ"].ToString() != "0.00") { TextBox_WC.Text = OP_Mode.Dtv[i]["WCBZ"].ToString(); } if (OP_Mode.Dtv[i]["ZSBZ"].ToString() != "0.00") { TextBox_ZS.Text = OP_Mode.Dtv[i]["ZSBZ"].ToString(); } if (OP_Mode.Dtv[i]["DRZS"].ToString() != "0.00") { TextBox_DRZS.Text = OP_Mode.Dtv[i]["DRZS"].ToString(); } TextBox_TXR.Text = OP_Mode.Dtv[i]["TXR"].ToString(); TextBox_MC.Text = OP_Mode.Dtv[i]["MC"].ToString(); TextBox_Becity.Text = OP_Mode.Dtv[i]["Becity"].ToString(); TextBox_Arrival.Text = OP_Mode.Dtv[i]["Arrival"].ToString(); TextBox_Arrival.Text = OP_Mode.Dtv[i]["Arrival"].ToString(); TextBox_Num.Text = OP_Mode.Dtv[i]["BXJE"].ToString(); TextBox_Remark2.Text = OP_Mode.Dtv[i]["Remark"].ToString(); //TextBox_DRZS. } else { AddImagesShow(OP_Mode.Dtv[i]["Image"].ToString(), OP_Mode.Dtv[i]["Image2"].ToString(), OP_Mode.Dtv[i]["Image3"].ToString(), Convert.ToDateTime(OP_Mode.Dtv[i]["Occurrence"]).ToString("yyyy-MM-dd"), OP_Mode.Dtv[i]["KZXM"].ToString(), OP_Mode.Dtv[i]["TXR"].ToString(), OP_Mode.Dtv[i]["MC"].ToString(), OP_Mode.Dtv[i]["Becity"].ToString(), OP_Mode.Dtv[i]["Arrival"].ToString(), Convert.ToDouble(OP_Mode.Dtv[i]["BXJE"]), OP_Mode.Dtv[i]["Remark"].ToString(), Convert.ToDouble(OP_Mode.Dtv[i]["BreakFirst"]), Convert.ToDouble(OP_Mode.Dtv[i]["ZCBZ"]), Convert.ToDouble(OP_Mode.Dtv[i]["WCBZ"]), Convert.ToDouble(OP_Mode.Dtv[i]["ZSBZ"]), Convert.ToDouble(OP_Mode.Dtv[i]["DRZS"]), Convert.ToInt32(OP_Mode.Dtv[i]["ID"]), bDel); } } } } } else { Label_No.Text = "等待生成编号"; Label_CName.Text = UserNAME; TextBox_Cname.Text = UserNAME; } } catch { Label_No.Text = "待生成编号"; } /// 依据选择显示文本框 ShowTextBox(); }
/// <summary> /// 依据类别保存数据,1、正常上课 2、请假 3、旷课 /// </summary> /// <param name="iFlag"></param> private void SaveClassData(int iFlag) { try { if (Convert.ToInt32(DefaultUser) <= 0) { return; } int StudentID = Convert.ToInt32(Request["SID"]); int iClassID = Convert.ToInt32(Request["CID"]); string strSQL = string.Empty; switch (iFlag) { case 1: strSQL = "Insert into XMFight_Class_Record (StudentID,iFlag,iCount,UserID,Remark) values (" + StudentID + ",1,-1," + DefaultUser + ",'" + TextBox_Remark.Text.Replace("'", "''") + "')"; break; case 2: strSQL = "Insert into XMFight_Class_Record (StudentID,iFlag,iCount,UserID,Remark) values (" + StudentID + ",2,0," + DefaultUser + ",'" + TextBox_Remark.Text.Replace("'", "''") + "')"; break; case 3: strSQL = "Insert into XMFight_Class_Record (StudentID,iFlag,iCount,UserID,Remark) values (" + StudentID + ",3,-1," + DefaultUser + ",'" + TextBox_Remark.Text.Replace("'", "''") + "')"; break; } //switch (iFlag) //{ // case 1: // strSQL = "Insert into XMFight_Class_Record (StudentID,iFlag,iCount,UserID,Remark) values (" + StudentID + ",1,-1,6,'" + TextBox_Remark.Text.Replace("'", "''") + "')"; // break; // case 2: // strSQL = "Insert into XMFight_Class_Record (StudentID,iFlag,iCount,UserID,Remark) values (" + StudentID + ",2,0,6,'" + TextBox_Remark.Text.Replace("'", "''") + "')"; // break; // case 3: // strSQL = "Insert into XMFight_Class_Record (StudentID,iFlag,iCount,UserID,Remark) values (" + StudentID + ",3,-1,6,'" + TextBox_Remark.Text.Replace("'", "''") + "')"; // break; //} strSQL += " Select ID, Name, Sex, Remark, Tel, BrithDay, datediff(year, BrithDay, getdate()) age,HeadImg,OpenID"; strSQL += " ,sumClassCount,LastClassTime,"; strSQL += " isnull((Select Count(ID) from XMFight_Class_Record where IFlag=2 and StudentID = a.ID),0) Leave,"; strSQL += " isnull((Select Count(ID) from XMFight_Class_Record where IFlag=3 and StudentID = a.ID),0) Absenteeism,"; strSQL += " isnull((Select sum(Bance) from XMFight_reserve where StudentID=a.ID),0) SumBance"; strSQL += " from XMFight_Student a,"; strSQL += " (Select sum(ICount) sumClassCount, MAX(CTime) LastClassTime, StudentID from XMFight_Class_Record group by StudentID) as b"; strSQL += " where a.ID = b.StudentID and a.id=" + StudentID; strSQL += " order by Name"; string strMSG = string.Empty; if (OP_Mode.SQLRUN(strSQL, "WeChatMsg")) { if (OP_Mode.Dtv1.Count > 0) { Openids = OP_Mode.Dtv1[0]["OpenID"].ToString(); if (Openids.Length > 5) { string[] strArray = Openids.Split(';'); if (iFlag == 1) { /// 正常上课 for (int i = 0; i < strArray.Length; i++) { /// 循环给用户发送信息 strMSG += SendXKMsg(strArray[i], OP_Mode.Dtv1[0]["Name"].ToString() + " 同学家长您好,您的孩子已经正常签到。", "自由搏击", OP_Mode.Dtv1[0]["sumClassCount"].ToString(), System.DateTime.Now.ToString("yyyy-MM-dd dddd HH:mm"), "-1 课时", "谢谢您对旭铭搏击的支持,坚持不懈是一种非常好的习惯。", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf60778eb4d1003de&redirect_uri=http%3A%2F%2Fptweb.x76.com.cn%2FXMFight&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"); } } else if (iFlag == 2) { /// 请假 for (int i = 0; i < strArray.Length; i++) { /// 循环给用户发送信息 strMSG += SendXKMsg(strArray[i], OP_Mode.Dtv1[0]["Name"].ToString() + " 同学家长您好,您的孩子由于请假未正常上课。", "自由搏击", OP_Mode.Dtv1[0]["sumClassCount"].ToString(), System.DateTime.Now.ToString("yyyy-MM-dd dddd HH:mm"), "0 课时", "坚持不懈才是对孩子的负责,请勿让孩子养成半途而废的习惯。", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf60778eb4d1003de&redirect_uri=http%3A%2F%2Fptweb.x76.com.cn%2FXMFight&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"); } } else if (iFlag == 3) { /// 旷课 for (int i = 0; i < strArray.Length; i++) { /// 循环给用户发送信息 strMSG += SendXKMsg(strArray[i], OP_Mode.Dtv1[0]["Name"].ToString() + " 同学家长您好,您的孩子已经旷课。请和工作人员联系说明情况。", "自由搏击", OP_Mode.Dtv1[0]["sumClassCount"].ToString(), System.DateTime.Now.ToString("yyyy-MM-dd dddd HH:mm"), "-1 课时", "旷课会正常扣除课时,如有特殊情况请及时联系工作人员。坚持不懈才是对孩子的负责,请勿让孩子养成半途而废的习惯。", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf60778eb4d1003de&redirect_uri=http%3A%2F%2Fptweb.x76.com.cn%2FXMFight&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"); } } } //if (strMSG.Length > 0) //{ // MessageBox("", strMSG); //} //else //{ MessageBox("", "操作成功。", "/XMFight/Manage/Class.aspx"); //} return; } } else { MessageBox("", "操作失败。<br/>错误:" + OP_Mode.strErrMsg, "/XMFight/Manage/Students.aspx"); return; } } catch (Exception ex) { MessageBox("", "您没有操作权限。" + ex, "/XMFight/"); return; } }
/// <summary> /// 模块列表读取 /// </summary> private void Load_GridView1() { // 获取GridView排序数据列及排序方向 string sortExpression = this.GridView1.Attributes["SortExpression"]; string sortDirection = this.GridView1.Attributes["SortDirection"]; string strSQL; strSQL = "Select w_bxd1.id,username,W_BXD1.bxdh,Occurrence,KZXM,W_BXD1.Remark SY,flag,FLAG,W_BXD2.BREAKFIRST,ZCBZ,WCBZ,ZSBZ,DRZS,TXR,MC,BECITY,ARRIVAL,BXJE,W_BXD2.REMARK,IMAGE from W_BXD1,W_BXD2 where w_bxd1.bxdh=w_bxd2.bxdh and flag>0 "; if (this.GridView1_Label_tj.Text.Length > 0) { strSQL += " And " + this.GridView1_Label_tj.Text.Trim(); } string strCheckBox = GetChecked(CheckBoxList1); if (strCheckBox.Length > 0) {// 添加复选框条线 strSQL += " and KZXM in (" + strCheckBox + ") "; } /// 增加排序条件 strSQL += " Order By username,Occurrence desc"; if (OP_Mode.SQLRUN(strSQL)) { /// 设置排序 if ((!string.IsNullOrEmpty(sortExpression)) && (!string.IsNullOrEmpty(sortDirection))) { OP_Mode.Dtv.Sort = string.Format("{0} {1}", sortExpression, sortDirection); } /// 设置翻页层始终显示 if (OP_Mode.Dtv.Count == 0) { OP_Mode.Dtv.AddNew(); } this.GridView1.DataSource = OP_Mode.Dtv; this.GridView1.DataBind(); } else { MessageBox("", strSQL + "<br/>" + OP_Mode.strErrMsg); return; } }