protected void btnSave_Click(object sender, EventArgs e) { BLL.BLLBase bll = new BLL.BLLBase(); bll.ExecNonQuery("Security.DeleteQuickDestop", new DataParameter[] { new DataParameter("@UserID", Convert.ToInt32(Session["UserID"].ToString())) }); foreach (TreeNode tnRoot in this.sTreeModule.Nodes) { foreach (TreeNode tnSub in tnRoot.ChildNodes) { if (tnSub.Checked) { string strModuleID = tnSub.Value; bll.ExecNonQuery("Security.InsertQuickDestop", new DataParameter[] { new DataParameter("@UserID", Convert.ToInt32(Session["UserID"].ToString())), new DataParameter("@ModuleID", strModuleID) }); } } } JScript.ShowMessage(this, "设置成功!"); }
public static void deleteFromGridView(GridView gv, string tableName, EeekSoft.Web.PopupWin PopupWin1) { int count = 0; if (gv.Rows.Count > 0) { for (int i = 0; i < gv.Rows.Count; i++) { CheckBox ck = gv.Rows[i].Cells[1].FindControl("chkSelect") as CheckBox; Label lb = gv.Rows[i].Cells[2].FindControl("lbID") as Label; if (ck.Checked) { SQLHelper.ExecuteNonQuery("delete from " + tableName + " where id = " + lb.Text); count++; } } } JScript.ShowMsg(PopupWin1, "Delete " + count.ToString() + " Records!"); Log.writeLog(System.Web.HttpContext.Current.Request.Cookies["user"].Values["id"], System.Web.HttpContext.Current.Request.Cookies["user"].Values["name"], "Delete " + tableName, "Count: " + count.ToString()); }
protected void Button1_Click(object sender, EventArgs e) { string order_number = this.TextOrder_num.Value.Trim(); pid = Request.QueryString["pid"]; // string order_number = TextOrder_num.Value; string courseID = this.HiddenCourse.Value; string getSql = "update H_Order set order_number='" + order_number + "',course_id=" + courseID + " where id=" + pid + ""; if (DbHelperSQL.ExecuteSql(getSql) > 0) { JScript.AlertAndRedirect("操作成功!", "OrderList.aspx", this); //JScript.Alert("操作成功!", "a2", this); //Response.Redirect("OrderList.aspx"); } else { JScript.Alert("操作失败!", "a2", this); } }
//在待办状态下接单 protected void btnAccept_Click(object sender, EventArgs e) { object obj = DBOpt.dbHelper.ExecuteScalar("select f_planday from dmis_sys_flowlink where f_no=" + ViewState["CurLinkNo"]); string finishedTime = ""; if (obj != null) { finishedTime = WebWorkFlow.GetLastTime(DateTime.Now, Convert.ToUInt32(obj)); } _sql = "update dmis_sys_workflow set f_working=1,f_receiver='" + Session["MemberName"].ToString() + "',f_receivedate='" + DateTime.Now.ToString("dd-MM-yyyy HH:mm") + "',F_LAST_FINISHED_TIME='" + finishedTime + "' where f_no=" + ViewState["CurWorkFlowNo"]; if (DBOpt.dbHelper.ExecuteSql(_sql) < 0) { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkAcceptTaskFailMessage").ToString()); //"接单失败!" return; } Session["Oper"] = 1; Response.Redirect(Page.Request.RawUrl); }
/// <summary> /// 删除按钮处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDelete_Click(object sender, EventArgs e) { B_ReceiveEdit l_BusReceiveEdit = null; if (String.IsNullOrEmpty(txtDocumentNo.Text.TrimEnd())) { JScript.ShowMsgBox(this.Page, "请先选择一条收文记录!", false); return; } l_BusReceiveEdit = new B_ReceiveEdit(); l_BusReceiveEdit.ID = Convert.ToInt32(txtRegisterID.Text); if (l_BusReceiveEdit.Delete()) { JScript.ShowMsgBox(this.Page, "删除成功", false); ClearEditField(); LoadRegisterList(); } }
//根据部门ID条件过滤。 protected override void btnSearch_Click(object sender, EventArgs e) { if (Session["MainTableId"] == null || Session["MainTableId"].ToString().Trim() == "") { JScript.Alert((String)GetGlobalResourceObject("WebGlobalResource", "NoTableID")); return; } if (!SetRight.IsAdminitrator(Session["MemberID"].ToString())) { JScript.OpenWindow("../SYS_Common/frmSearchBuild.aspx?Precondition=DEPART_ID=" + Session["DepartID"].ToString(), (String)GetGlobalResourceObject("WebGlobalResource", "SearchBuildWindow"), "resizable=1,scrollbars=1,width=700px,height=500px,left=100px,top=10px"); } else { JScript.OpenWindow("../SYS_Common/frmSearchBuild.aspx", (String)GetGlobalResourceObject("WebGlobalResource", "SearchBuildWindow"), "resizable=1,scrollbars=1,width=700px,height=500px,left=100px,top=10px"); } }
protected void btnEnter_Click(object sender, EventArgs e) { //查询是否可以过站 string result = CRUD.QueryStationOfLot(lblWorksiteID.Text, txtLot.Text); if (result != "success") { JScript.Alert(result, this); txtLot.Text = ""; return; } DataTable lotDt = CRUD.GetLotBasisInfo(txtLot.Text); ViewState["lotDt"] = lotDt; string workshop = lotDt.Rows[0]["workshopID"].ToString(); setddl(workshop); string WO = lotDt.Rows[0]["workorder"].ToString(); ViewState["WO"] = WO; #region 批次流程 //查询批次流程 CRUD.setLabelProcess(lblLotprocess, lblCurrnentWorksite, lblEndProcess, txtLot.Text, lblWorksiteID.Text); #endregion //FilmCRUD.GetPreLengthAndWidth(txtPreLength, txtPreWidth, txtLot.Text, lblWorksiteID.Text, WO, ""); //txtRestLength.Text = lotDt.Rows[0]["restlength"].ToString(); //txtPreLength.Text = lotDt.Rows[0]["mouldlength"].ToString(); //txtPreWidth.Text = lotDt.Rows[0]["mouldwidth"].ToString(); //=======前站宽幅长度和剩余长度取有效值 modify by lei.xue on 2017-6-1================ txtRestLength.Text = lotDt.Rows[0]["restlength"].ToString(); txtPreLength.Text = lotDt.Rows[0]["validlength"].ToString(); txtPreWidth.Text = lotDt.Rows[0]["validwidth"].ToString(); //==========标签增加产品类型 add by lei.xue on 2017-5-20================ txtProductType.Text = lotDt.Rows[0]["producttype"].ToString(); LabelInfo(); }
protected void btnSave_Click(object sender, EventArgs e) { Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(CompID); if (comp != null) { comp.Tel = Common.NoHTML(txtTel.Value.Trim()); comp.Fax = Common.NoHTML(txtFax.Value.Trim()); comp.Principal = Common.NoHTML(txtPrincipal.Value.Trim()); comp.Address = Common.NoHTML(txtAddress.Value.Trim()); if (txtPhone.Value.Trim() != "") { comp.Phone = Common.NoHTML(txtPhone.Value.Trim()); } else { List <Hi.Model.SYS_CompUser> User2 = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and utype=4 and CompID=" + CompID + "", ""); if (User2.Count > 0) { Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(User2[0].UserID); if (User != null) { comp.Phone = Common.NoHTML(User.Phone); } } } comp.BrandInfo = Common.NoHTML(this.BrandIfon.Value.Trim()); comp.CompLogo = Common.NoHTML(HDCompPath.Value); comp.CustomCompinfo = txtCustomInfo.Text; if (new Hi.BLL.BD_Company().Update(comp)) { if (Request["nextstep"] + "" == "1") { JScript.AlertMethod(this, "恭喜您成功入驻医站通,您的商城您做主,尽情享受您的电商之旅吧!", JScript.IconOption.笑脸, "function () { onlinkOrder('../newOrder/orderBuy.aspx', 'dkxd') }"); } else { Response.Redirect("CompInfo.aspx"); } } } }
/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDel_Click(object sender, EventArgs e) { DataTable dt = Common.GoodsIsExist2(this.CompID.ToString()); if (dt.Rows.Count != 0) { string strmsg = string.Empty; foreach (RepeaterItem row in this.rptGoods.Items) { CheckBox cb = row.FindControl("CB_SelItem") as CheckBox; if (cb != null && cb.Checked) { HiddenField fld = row.FindControl("HF_GoodsName") as HiddenField; HiddenField fld2 = row.FindControl("HF_Id") as HiddenField; if (fld != null) { string name = fld.Value; int id = fld2.Value.ToInt(0); DataRow[] rows = dt.Select(" GoodsID ='" + id + "'"); if (rows.Length > 0) { strmsg += "商品名:" + name + "<br>"; } } } } if (!Util.IsEmpty(strmsg)) { JScript.AlertMethod(this, strmsg + "已有订单存在商品,不能删除", JScript.IconOption.错误); } else { DelGoods(); } } else { DelGoods(); } Bind(); }
protected virtual void Page_PreInit(object sender, EventArgs e) { if (Session["MemberID"] == null) { JScript.ReturnLogin(); } if (Session["Theme"] == null) { Page.Theme = "default"; } else { Page.Theme = Session["Theme"].ToString(); } if (!Page.IsPostBack) { // Session["Url"] =Request["URL"]; } }
protected void btnlogin_click(object sender, EventArgs e) { var uid = this.txtuid.Value.Trim(); var password = this.txtpwd.Value.Trim(); if (uid == "" || uid == "帐号" || password == "" || password == "密码") { JScript.AlertMethod(this, "用户名或密码不能为空!!!", JScript.IconOption.错误, "function(){location.href='index.aspx';}"); return; } else { string jsonUser = "******"type\":\"1\",\"username\":\"" + this.txtuid.Value.Trim() + "\",\"password\":\"" + this.txtpwd.Value.Trim() + "\",\"logo\":\"\"}"; user = new AESHelper(inKey).KeyEncrypt(jsonUser, out sign, out validity); string url = System.Configuration.ConfigurationManager.AppSettings["WebDomainName"].ToString() + "/SSOLogin.aspx?user="******"&sign=" + sign + "&valid=" + validity; ClientScript.RegisterStartupScript(GetType(), "ssologin", "<script>window.location.href='" + url + "'</script>"); } }
protected override void btnSearch_Click(object sender, EventArgs e) { if (trvStation.SelectedNode == null) { JScript.Alert("请先选择某一厂站!"); return; } if (wdlStart.getTime() > wdlEnd.getTime()) { JScript.Alert("开始日期不能大于结束日期!"); return; } string startDate, endDate; startDate = wdlStart.getTime().ToString("yyyy-MM-dd") + " 00:00"; endDate = wdlEnd.getTime().ToString("yyyy-MM-dd") + " 23:59"; ViewState["sql"] = "select * from DMIS_SYS_PACK where f_createdate>='" + startDate + "' and f_createdate<='" + endDate + "' and f_msg='" + trvStation.SelectedNode.Text + "' order by F_PACKNAME,f_createdate"; GridViewBind(); }
private void LabelInfo(string eqp) { //查询UV成型分批子批序列号最大数量 modify by lei.xue on 2017-3-27========================================= string strResult = UVComplete.QueryMaxUVCompleteLotID(eqp, ddlWorkshop.SelectedValue); int intQty = 0; if (strResult != "fail") { intQty = Convert.ToInt32(strResult) + 1; } else { JScript.Alert("查询分批数量出错", this); return; } //string Qty = (Convert.ToInt32(UVComplete.QueryMaxUVCompleteLotID()) + 1).ToString(); string Qty = intQty.ToString(); txtLabelInfo.Text = eqp + System.DateTime.Now.ToString("yy") + Convert.ToInt32(Qty).ToString("00000"); }
protected void btn_NEnabled(object sender, EventArgs e) { Hi.Model.SYS_CompUser user = new Hi.BLL.SYS_CompUser().GetModel(KeyID); if (user != null) { if (user.IsEnabled == 1) { user.IsEnabled = 0; user.modifyuser = UserID; user.ts = DateTime.Now; if (new Hi.BLL.SYS_CompUser().Update(user)) { JScript.AlertMethod(this, "用户禁用成功", JScript.IconOption.正确, "function(){ window.location.href=window.location.href; }"); } } else { JScript.AlertMethod(this, "用户已是禁用状态!", JScript.IconOption.错误, "function(){ window.location.href=window.location.href; }"); } } }
protected void btnSearch_Click(object sender, System.EventArgs e) { try { pageIndex = 1; //TableView = ViewState["tableView"].ToString(); filter = string.Format(" {0} like '%{1}%' ", this.ddlFieldName.SelectedValue, this.txtSearch.Text.Trim()); if (Request.QueryString["Where"] != "" && Request.QueryString["Where"] != null) { filter += " AND " + Request.QueryString["Where"].Replace('"', "'"[0]); } ViewState["filter"] = filter; BindGrid(pageIndex); } catch (Exception exp) { JScript.ShowMessage(this.UpdatePanel1, exp.Message); } }
/// <summary> /// 商品资格证查看 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void FileOut_Click(object sender, EventArgs e) { string fileName = this.FileName.Value.Trim();; string filePath = Server.MapPath("../../UploadFile/") + fileName; if (File.Exists(filePath)) { FileInfo file = new FileInfo(filePath); Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8"); //解决中文乱码 Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(file.Name.Substring(0, file.Name.LastIndexOf("_")) + Path.GetExtension(file.Name))); //解决中文文件名乱码 Response.AddHeader("Content-length", file.Length.ToString()); Response.ContentType = "appliction/octet-stream"; Response.WriteFile(file.FullName); Response.Flush(); Response.End(); } else { JScript.AlertMsgOne(this, "附件不存在!", JScript.IconOption.错误); } }
private void LabelInfo() { //查询UV成型分批子批序列号最大数量 modify by lei.xue on 2017-3-27========================================= string strResult = AGCoating.QueryMaxAGCoatingLotID(txtLot.Text); int intQty = 0; if (strResult != "fail") { intQty = Convert.ToInt32(strResult) + 1; } else { JScript.Alert("查询分批数量出错", this); return; } //string Qty = (Convert.ToInt32(UVComplete.QueryMaxUVCompleteLotID()) + 1).ToString(); string Qty = intQty.ToString(); txtLabelInfo.Text = txtLot.Text + "-" + Convert.ToInt32(Qty).ToString("00"); }
protected void Page_Load(object sender, EventArgs e) { if (Request["action"] == "add") { Model.MenuInfoModel model = new Model.MenuInfoModel(); model.MenuName = Request["menuName"]; model.MenuUrl = Request["menuUrl"]; model.OrderId = Common.TypeHelper.ObjectToInt(Request["OrderId"], 0); model.Bid = Common.TypeHelper.ObjectToInt(Request["bid"], 0); model.StatusId = Common.TypeHelper.ObjectToInt(Request["StatusId"], 0); int i = dal.Add(model); if (i > 0) { JScript.alert("ok", "操作成功", this.Page, "admin_menu.aspx?" + menuUrl); } else { } } }
protected override void btnPrint_Click(object sender, EventArgs e) { if (Session["ReportId"] == null || Session["ReportId"].ToString().Trim() == "") { Response.Write("<script language=javascript> alert('" + GetGlobalResourceObject("WebGlobalResource", "NoReportMessage").ToString() + "')</script"); return; } if (wdlDate.Text == "") { return; } if (ddlShift.SelectedItem == null) { return; } string shiftDate = wdlDate.getTime().ToString("dd-MM-yy"); string shift = ddlShift.SelectedValue; JScript.OpenWindow("../SYS_Common/frmCellReportDisplay.aspx?ReportID=" + Session["ReportId"].ToString() + "&Values=" + shiftDate + "^" + shift, "报表打印", "toolbar=no,menubar=no,titlebar=yes,directories=no,resizable=yes,status=yes"); }
protected void grvList_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "view") { grvList.SelectedIndex = Convert.ToInt16(e.CommandArgument); Session["FileTid"] = grvList.SelectedDataKey.Value; object obj = DBOpt.dbHelper.ExecuteScalar("select count(*) from T_FILE_ACCESSORIES where FILE_ID=" + Session["FileTid"].ToString()); if (obj == null || Convert.ToInt16(obj) == 0) { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "FileNoAccessories").ToString()); //"没有上传的附件!" return; } else { string tt = "window.open('FileViewMainFrame.htm','FileViewMainFrame','scrollbars=1,resizable=1');"; Response.Write("<script language=javascript>"); Response.Write(tt); Response.Write("</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { this.GridView2.PageSize = pageSubSize; SqlCmd = "WMS.SelectBillMaster"; if (!IsPostBack) { ViewState["filter"] = "BillID like 'RS%'"; ViewState["CurrentPage"] = 1; try { DataTable dt = SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1); SetBindDataSub(dt); } catch (Exception exp) { JScript.ShowMessage(this.UpdatePanel1, exp.Message); } } ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.UpdatePanel1.GetType(), "Resize", "resize();", true); }
protected void btnSubMit_Click(object sender, EventArgs e) { Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(KeyID); if (comp != null) { if (string.IsNullOrWhiteSpace(txtCreateDate.Value.Trim())) { JScript.AlertMsg(this, "起始日期不能为空"); return; } if (string.IsNullOrWhiteSpace(txtEndCreateDate.Value.Trim())) { JScript.AlertMsg(this, "结束日期不能为空"); return; } comp.EnabledStartDate = Convert.ToDateTime(txtCreateDate.Value); comp.EnabledEndDate = Convert.ToDateTime(txtEndCreateDate.Value); new Hi.BLL.BD_Company().Update(comp); ClientScript.RegisterStartupScript(this.GetType(), "MSG", "<script>window.parent.location.href=window.parent.location.href; </script>"); } }
protected void btnRefresh_Click(object sender, EventArgs e) { try { pageIndex = 1; //TableView = ViewState["tableView"].ToString(); if (Request.QueryString["Where"] != "" && Request.QueryString["Where"] != null) { filter = Request.QueryString["Where"].Replace('"', "'"[0]); } ViewState["filter"] = filter; BindGrid(pageIndex); } catch (Exception exp) { JScript.ShowMessage(this.UpdatePanel1, exp.Message); } }
protected void btnAdd_Click(object sender, EventArgs e) { if (ddlPackType.SelectedItem == null || ddlPackType.SelectedIndex == 0) { JScript.Alert("请先选择要新建的业务类别"); return; } int PackTypeNo = Convert.ToInt16(ddlPackType.SelectedValue); //查找起始节点编号 int CurLinkNo = Convert.ToInt16(DBOpt.dbHelper.ExecuteScalar("select f_no from dmis_sys_flowlink where f_packtypeno=" + PackTypeNo + " and f_flowcat=0")); //找对应的文档,目前的设计思想只能对应一个文档 DataTable docType = DBOpt.dbHelper.GetDataTable("select f_no,f_formfile,f_tablename,f_target from dmis_sys_doctype where f_packtypedef=1 and f_packtypeno=" + PackTypeNo); if (docType == null || docType.Rows.Count < 1) { JScript.Alert("无法找到相应的文档!"); return; } Session["Oper"] = 1; Response.Redirect(docType.Rows[0][1].ToString() + "?" + @"BackUrl=" + Page.Request.RawUrl + "&PackTypeNo=" + PackTypeNo + "&CurLinkNo=" + CurLinkNo); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["filter"] = "Flag=6"; ViewState["CurrentPage"] = 1; try { SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1); } catch (Exception exp) { JScript.ShowMessage(this.UpdatePanel1, exp.Message); } writeJsvar(FormID, SqlCmd, ""); } ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.UpdatePanel1.GetType(), "Resize", "resize();", true); }
/// <summary> /// 新增 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SubOk_Click(object sender, EventArgs e) { int Id = Convert.ToInt32(Request["Selectbank"]); Hi.Model.PAY_BankInfo bankModel = new Hi.BLL.PAY_BankInfo().GetModel(Id); string code = string.Empty; string name = string.Empty; //Response.Redirect("StockOutAdd.aspx?Id=" + Id); if (bankModel == null) { JScript.AlertAndRedirect("请选择银行!", "PaySelectBank.aspx"); return; } else { code = bankModel.BankCode; name = bankModel.BankName; } this.ScriptManage.InnerHtml = string.Format("<script>doSelectMaterials('{0}','{1}');</script>", code, name); }
protected void btnSave_Click(object sender, EventArgs e) { if (strID == "") //新增 { int Count = bll.GetRowCount("CMD_ProductCategory", string.Format("CategoryCode='{0}'", this.txtID.Text)); if (Count > 0) { JScript.ShowMessage(this.Page, "该类别编码已经存在!"); return; } bll.ExecNonQuery("Cmd.InsertProductCategory", new DataParameter[] { new DataParameter("@CategoryCode", this.txtID.Text.Trim()), new DataParameter("@CategoryName", this.txtProductTypeName.Text.Trim()), new DataParameter("@WarehouseCode", ""), new DataParameter("@AreaCode", ""), new DataParameter("@Memo", this.txtMemo.Text.Trim()), new DataParameter("@Creator", Session["EmployeeCode"].ToString()), new DataParameter("@Updater", Session["EmployeeCode"].ToString()) }); } else //修改 { string Comd = "Cmd.UpdateProductCategory"; DataParameter[] paras = new DataParameter[] { new DataParameter("@CategoryName", this.txtProductTypeName.Text.Trim()), new DataParameter("@WarehouseCode", ""), new DataParameter("@AreaCode", ""), new DataParameter("@Memo", this.txtMemo.Text.Trim()), new DataParameter("@Updater", Session["EmployeeCode"].ToString()), new DataParameter("@CategoryCode", this.txtID.Text.Trim()) }; bll.ExecNonQuery(Comd, paras); } Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text)); }
//统计 protected void btnAdd_Click(object sender, EventArgs e) { DateTime startDate, endDate; startDate = wdlStart.getTime(); endDate = wdlEnd.getTime(); if (startDate > endDate) { JScript.Alert("开始日期不能大于结束日期!"); return; } if (ddlMember.SelectedItem == null) { JScript.Alert("请先选择某一人员!"); return; } _sql = "select a.F_NAME as F_PACKNAME,b.F_DESC,b.F_PACKTYPENO,c.F_PACKNO,c.F_NO as F_WORKFLOWNO,c.F_FLOWNAME,c.F_RECEIVEDATE,c.F_FINISHDATE,c.F_PLANDAY,c.F_WORKDAY " + " from DMIS_SYS_PACKTYPE a,DMIS_SYS_PACK b,DMIS_SYS_WORKFLOW c where " + " a.f_no=b.F_PACKTYPENO and b.f_no=c.F_PACKNO and c.F_RECEIVER='" + ddlMember.SelectedItem.Text + "' order by c.F_RECEIVEDATE"; DataTable dt = DBOpt.dbHelper.GetDataTable(_sql); ViewState["dt"] = dt; rows = dt.Rows.Count; _sql = "select sum(c.F_WORKDAY) " + " from DMIS_SYS_PACKTYPE a,DMIS_SYS_PACK b,DMIS_SYS_WORKFLOW c where " + " a.f_no=b.F_PACKTYPENO and b.f_no=c.F_PACKNO and c.F_RECEIVER='" + ddlMember.SelectedItem.Text + "' order by c.F_RECEIVEDATE"; object obj = DBOpt.dbHelper.ExecuteScalar(_sql); if (obj is System.DBNull) //注意不是 obj==null { totalHours = 0; } else { totalHours = Convert.ToDouble(obj); } GridViewBind(); }
//退回操作 protected void btnWithdraw_Click(object sender, EventArgs e) { //退回前先保存 btnSave_Click(null, null); if (tdMessage.InnerText != "") { return; } _sql = "SELECT F_PREFLOWNO FROM DMIS_SYS_WORKFLOW WHERE F_PACKNO=" + ViewState["PackNo"] + " AND F_NO=" + ViewState["CurWorkFlowNo"] + " AND F_RECEIVER='" + Session["MemberName"] + "'"; object obj = DBOpt.dbHelper.ExecuteScalar(_sql); if (obj == null) { //Response.Write("<script language=javascript>alert('只有主办人使用');</script>"); return; } if (Convert.ToInt16(obj) < 0) { Response.Write("<script language=javascript>alert('" + GetGlobalResourceObject("WebGlobalResource", "WkFirstStepNoWithdraw").ToString() + "');</script>"); //流程的开始步骤不允许退回 return; } //判断分支节点能否退回。 if (!WebWorkFlow.IsCanWithdraw(Convert.ToInt16(ViewState["PackTypeNo"]), Convert.ToInt16(ViewState["PackNo"]), Convert.ToInt16(ViewState["CurLinkNo"]), Convert.ToInt16(ViewState["CurWorkFlowNo"]))) { JScript.Alert(GetGlobalResourceObject("WebGlobalResource", "WkHasNextWorkingStepNoWithdraw").ToString()); //"还有下级任务在处理,不允许退回" return; } string paras; paras = "PackTypeNo=" + ViewState["PackTypeNo"] + "&CurLinkNo=" + ViewState["CurLinkNo"] + "&PackNo=" + ViewState["PackNo"] + "&CurWorkFlowNo=" + ViewState["CurWorkFlowNo"] + "&PreCurWorkFlowNo=" + obj.ToString(); Response.Write("<script language=javascript>"); Response.Write("window.open('../SYS_WorkFlow/InstanceWithdrawPopMessage.aspx?" + paras + "','退回'" + ",'height=200,width=440,top=100,left=100,scrollbars=no,resizable=yes');"); Response.Write("</script>"); }
protected void Article_Insert(object sender, EventArgs e) { if (titleTextBox.Text == "") { JScript.Alert("请输入产品名称", this); return; } string strConnection = ConfigurationManager.ConnectionStrings["AccessConnectionString"].ConnectionString; OleDbConnection objConnection = new OleDbConnection(strConnection); objConnection.Open(); using (objConnection) { string strSQL = "INSERT INTO CPTable(CPName,CPInf,CPDetails,CPPicURL,CPLBID,CPInMainPage) values (@title,@inf,@content,@newsPic,@lbID,@inMain)"; OleDbCommand command = new OleDbCommand(strSQL, objConnection); command.Parameters.Add("@title", OleDbType.VarChar).Value = titleTextBox.Text; command.Parameters.Add("@inf", OleDbType.VarChar).Value = infTextBox.Text; command.Parameters.Add("@content", OleDbType.VarChar).Value = contentTextBox.Text; command.Parameters.Add("@newsPic", OleDbType.VarChar).Value = Txt_newsPicURL.Text; command.Parameters.Add("@lbID", OleDbType.Integer).Value = parentIDDropDown.SelectedValue; //command.Parameters.Add("@inMain", OleDbType.Boolean).Value = inMainPageCheckBox.Checked; command.Parameters.Add("@inMain", OleDbType.Boolean).Value = false; if (command.ExecuteNonQuery() > 0) { MyBasePage.writeLog(Session["userName"].ToString(), "添加新闻或通知,标题:" + titleTextBox.Text); JScript.AlertAndRedirect("产品信息已添加", "", this); NewsListPanel.Visible = true; EditPanel.Visible = false; ViewPanel.Visible = false; } else { MyBasePage.writeLog(Session["userName"].ToString(), "添加新闻或通知时发生错误,返回受影响数据库条数为零。欲添加标题: " + titleTextBox.Text); JScript.AlertAndRedirect("添加产品信息时发生错误", "", this); } } }
public void Run() { try { switch(scriptLanguage) { case ScriptLanguage.JScript: scriptEngine = new JScript(); break; case ScriptLanguage.VBScript: scriptEngine = new VBScript(); break; default: throw new CoAppException("Invalid Script Language"); } EXCEPINFO info; ActiveScriptParse.InitNew(); ActiveScript.SetScriptSite(this); // add this object in GlobalMembers.Add("WScript", this); foreach(string key in GlobalMembers.Keys) ActiveScript.AddNamedItem(key, ScriptItem.IsVisible | ScriptItem.GlobalMembers); ActiveScriptParse.ParseScriptText(ScriptText, null, IntPtr.Zero, null, 0, 0, 0, IntPtr.Zero, out info); ActiveScript.SetScriptState((uint) ScriptState.Connected); } catch(Exception e) { Console.WriteLine(e.Message); } }