protected override void billDelRow() { if (string.IsNullOrWhiteSpace(docBILLNO.Text)) { Alert.Show("空单据,无法进行【删行】操作"); return; } if (docFLAG.SelectedValue != "M") { Alert.Show("非新单,不能进行【删行】操作!"); return; } if (GridLis.SelectedCell == null) { return; } int rowIndex = GridLis.SelectedRowIndex; if (rowIndex < 0) { return; } PageContext.RegisterStartupScript(Confirm.GetShowReference("确认要对第【" + (rowIndex + 1) + "】行进行【删行】的操作吗?", "警告提示", MessageBoxIcon.Information, PageManager1.GetCustomEventReference("billDelRow_Ok"), PageManager1.GetCustomEventReference("billDelRow_Cancel"))); //,true //20150510 liuz List <Dictionary <string, object> > newDict = GridLis.GetNewAddedList(); newDict.RemoveAt(rowIndex); }
protected void btnOperation_Click(object sender, EventArgs e) { PageContext.RegisterStartupScript(Confirm.GetShowReference("操作成功!点击确定按钮开始下载文件,点取消按钮弹出对话框", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), // 第一个参数 false 用来指定当前不是AJAX请求 PageManager1.GetCustomEventReference("Confirm_Cancel"))); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { btnOperation.OnClientClick = Confirm.GetShowReference("确认执行操作?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference("Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel")); } }
protected void menuTreeBind(string userId) { try { if (userId != null || userId != "") { string sqlCmd = "select * from OA_Sys_Menu where id in( "; sqlCmd += "select menuId from OA_Sys_RoleMenu where roleid in ( "; sqlCmd += "select roleid from OA_Sys_UserRole where userid=( "; sqlCmd += "select id from OA_Sys_EmployeeInfo where id='" + userId + "')) group by menuId) and enabled=1 order by parentMenuId,SortIndex"; DataTable treeDt = new DataTable(); SqlSel.GetSqlSel(ref treeDt, sqlCmd); DataSet ds = new DataSet(); ds.Tables.Add(treeDt); ds.Relations.Add("TreeRelation", ds.Tables[0].Columns["Id"], ds.Tables[0].Columns["ParentMenuId"], false); foreach (DataRow row in ds.Tables[0].Rows) { if (row["ParentMenuId"].ToString() == "0") { TreeNode node = new TreeNode(); node.Text = row["Title"].ToString(); node.NodeID = row["id"].ToString(); //node.NavigateUrl = ResolveUrl(row["NavigateUrl"].ToString()); tree_menu.Nodes.Add(node); ResolveSubTree(row, node); } } if (tree_menu.Nodes.Count > 0) { tree_menu.Nodes[0].Expanded = true; } else { PageContext.RegisterStartupScript(Confirm.GetShowReference("您尚未配置系统权限!请联系管理员。", String.Empty, MessageBoxIcon.Error, PageManager1.GetCustomEventReference("Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); } } } catch (Exception ex) { Alert.ShowInTop(ex.Message); return; } }
private void LoadData() { StringBuilder sb = new StringBuilder(); sb.Append("<ul class=\"loading\">"); for (int i = 1; i <= 30; i++) { string imageUrl = PageManager1.GetLoadingImageUrl(i); sb.AppendFormat("<li class=\"\"><img src=\"{0}\"><div class=\"title\">{1}</div></li>", imageUrl, i); } sb.Append("</ul>"); litIcons.Text = sb.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindTree();//绑定部门 LoadData(); LoadPowerData(); btnDel.OnClientClick = Confirm.GetShowReference("确认执行删除操作?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference("Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel")); } }
protected void btnSave_Click(object sender, EventArgs e) { //201509211433 6448版本缺失 add by zhanghaicheng List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList().ToList(); if (newDict.Count == 0) { Alert.Show("没有生成任何数据!", "消息提示", MessageBoxIcon.Information); return; } int rowIndex = 0; foreach (Dictionary <string, object> dic in newDict) { rowIndex++; if ((dic["YSSL"] ?? "0").ToString() == "0") { PageContext.RegisterStartupScript(Confirm.GetShowReference("第【" + rowIndex + "】行预算数量为空或0,确认执行操作?", "操作提示", MessageBoxIcon.Question, PageManager1.GetCustomEventReference("Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); return; } } btnSave.Enabled = false; DataSave("N"); }
protected override void billSave() { PageContext.RegisterStartupScript(Confirm.GetShowReference("请确认拣货出库信息正确无误,是否继续执行?", "消息提示", MessageBoxIcon.Information, PageManager1.GetCustomEventReference("btnOk"), PageManager1.GetCustomEventReference("btnCancel"))); }
/// <summary> /// 下载模板按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDownLoad_Click(object sender, EventArgs e) { PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); }
private void save(string flag = "N") { #region 数据有效性验证 if (docFLAG.SelectedValue != "M" && docFLAG.SelectedValue != "R") { Alert.Show("非[新单]不能保存!", "消息提示", MessageBoxIcon.Warning); return; } if (PubFunc.FormDataCheck(FormDoc).Length > 0) { return; } List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList().ToList(); if (newDict.Count == 0) { Alert.Show("请输入商品信息", "消息提示", MessageBoxIcon.Warning); return; } List <Dictionary <string, object> > goodsData = new List <Dictionary <string, object> >(); string msg = ""; //判断是否有空行、批号填写是否符合要求 for (int i = 0; i < newDict.Count; i++) { if (!string.IsNullOrWhiteSpace(newDict[i]["GDSEQ"].ToString()) && !string.IsNullOrWhiteSpace(newDict[i]["GDNAME"].ToString())) { if (int.Parse(newDict[i]["BZSL"].ToString()) > int.Parse(newDict[i]["DHSL"].ToString())) { Alert.Show("第" + (i + 1) + "行商品【" + newDict[i]["GDNAME"].ToString() + "】【使用数】不允许大于【预入库数量】", "提示信息", MessageBoxIcon.Warning); return; } if (int.Parse(newDict[i]["BZSL"].ToString()) != int.Parse(newDict[i]["DHSL"].ToString())) { msg += "第" + (i + 1) + "行商品【" + newDict[i]["GDNAME"].ToString() + "】,"; } if ((newDict[i]["STR1"] ?? "").ToString().Length > 0 && (newDict[i]["BZSL"] ?? "").ToString() != "1") { Alert.Show("第" + (i + 1) + "行商品【" + newDict[i]["GDNAME"].ToString() + "】【使用数】不允许大于【预入库数量】", "提示信息", MessageBoxIcon.Warning); return; } } } #endregion if (!string.IsNullOrWhiteSpace(msg)) { msg += "【使用数】不等于【预入库数量】,确认保存,请选择【确定】"; PageContext.RegisterStartupScript(Confirm.GetShowReference(msg, "消息提示", MessageBoxIcon.Information, PageManager1.GetCustomEventReference("btnOk"), PageManager1.GetCustomEventReference("btnCancel"))); } else { btnOk(); } SaveSuccess = true; }
protected void update() { if (GridGoods.GetModifiedDict().Count > 0) { Dictionary <int, Dictionary <string, object> > modifiedDict = GridGoods.GetModifiedDict(); if (modifiedDict.Count > 0) { string LisRowno = ""; foreach (int rowIndex in modifiedDict.Keys) { LisRowno += GridGoods.DataKeys[rowIndex][0].ToString() + "," + modifiedDict[rowIndex]["PDSL"] + "#"; } AddCookies(LisRowno); PageContext.RegisterStartupScript(Confirm.GetShowReference("数据已被修改是否保存?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference("Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); } } else { page(tbxSEQNO.Text); } }
protected void btnSure_Click(object sender, EventArgs e) { //重新预占 呵呵 String Sql = @"SELECT TO_CHAR(WMSYS.WM_CONCAT(A.GDNAME)) FROM DAT_CK_COM A,(SELECT COUNT (1) SL,GDSEQ FROM DAT_CK_EXT WHERE BILLNO = '{0}' GROUP BY GDSEQ) B WHERE A.GDSEQ = B.GDSEQ AND A.SEQNO = '{0}' AND A.ISGZ = 'Y' AND A.XSSL <> B.SL"; Object err = DbHelperOra.GetSingle(String.Format(Sql, GridList.DataKeys[GridList.SelectedRowIndex][0])); if ((err ?? "").ToString().Length > 0) { PageContext.RegisterStartupScript(Confirm.GetShowReference("商品【" + err + "】扫描数与单据中商品数量不一致是否继续?", "提示信息", MessageBoxIcon.Information, PageManager1.GetCustomEventReference(true, "Confirm_Sure", false, false), null)); return; } else { Confirm_Sure(); WindowScan.Hidden = true; } }
protected void btnAuto_Click(object sender, EventArgs e) { if (lstDEPTOUT.SelectedValue.Length < 1) { Alert.Show("请选择出库库房!", "提示信息", MessageBoxIcon.Warning); return; } object obj = DbHelperOra.GetSingle("SELECT NUM1 FROM V_KCSP WHERE FLAG = 'Y' AND DEPTOUT = '" + lstDEPTOUT.SelectedValue + "'AND ROWNUM = '1'"); if ((obj ?? "").ToString().Length > 0) { Alert.Show("仓库存在未手工确认出库的波次,请检查!", "提示信息", MessageBoxIcon.Warning); TabStrip1.ActiveTabIndex = 1; hfdBCode.Text = obj.ToString(); HDataSearch(); return; } int[] index = GridList.SelectedRowIndexArray; if (index.Count() < 1) { Alert.Show("请选择需要分配的单据!", "提示信息", MessageBoxIcon.Warning); return; } string strBill = ""; foreach (int i in index) { strBill = strBill + "'" + GridList.DataKeys[i][0] + "',"; } if (DbHelperOra.Exists("SELECT 1 FROM V_KCSP WHERE SEQNO IN (" + strBill.TrimEnd(',') + ") AND FLAG IN ('Y','D','W')")) { Alert.Show("您选择的单据已被他人操作,请检查!", "提示信息", MessageBoxIcon.Warning); DataSearch(); return; } //判断是否进行调拨 if (DbHelperOra.Exists(String.Format(@"SELECT 1 FROM (SELECT A.GDSEQ,SUM(A.XSSL) SYSL FROM V_KCSP A,SYS_DEPT B WHERE A.DEPTOUT = B.CODE AND A.SEQNO IN ({1}) AND A.DEPTOUT = '{0}' AND B.ISORDER='N' AND A.BILLFLAG IN('S','N') GROUP BY A.GDSEQ) A, (SELECT GDSEQ,SUM(KCSL-LOCKSL) KCSL FROM DAT_GOODSSTOCK WHERE DEPTID = '{0}' AND KCSL > LOCKSL GROUP BY GDSEQ) B WHERE A.GDSEQ = B.GDSEQ(+) AND SYSL > NVL(KCSL,0)", lstDEPTOUT.SelectedValue, strBill.TrimEnd(',')))) { OracleParameter[] parameters = { new OracleParameter("VI_DEPTIN", OracleDbType.Varchar2, 20), new OracleParameter("VI_BILLNO", OracleDbType.Varchar2, 2000), new OracleParameter("VI_USER", OracleDbType.Varchar2, 20), new OracleParameter("VO_BILLNUM", OracleDbType.Varchar2, 20) }; parameters[0].Value = lstDEPTOUT.SelectedValue; parameters[1].Value = strBill.TrimEnd(',').Replace("'", ""); parameters[2].Value = UserAction.UserID; parameters[0].Direction = ParameterDirection.Input; parameters[1].Direction = ParameterDirection.Input; parameters[2].Direction = ParameterDirection.Input; parameters[3].Direction = ParameterDirection.Output; try { DbHelperOra.RunProcedure("STOREDS.P_DB_AUTOFP", parameters); if (parameters[3].Value != null) { Alert.Show("商品库存不足部分已转缺货!", "消息提示", MessageBoxIcon.Information); } else { Alert.Show("商品库存预占分配成功!", "消息提示", MessageBoxIcon.Information); } DataSearch(); } catch (Exception err) { Alert.Show(err.Message); } return; } if (DbHelperOra.Exists("SELECT 1 FROM V_KCSP WHERE SEQNO IN (" + strBill.TrimEnd(',') + ") AND FLAG IN ('D')")) { PageContext.RegisterStartupScript(Confirm.GetShowReference("分配单据中存在未调拨完成单据,是否继续?", "信息提示", MessageBoxIcon.Information, PageManager1.GetCustomEventReference(true, "Confirm_Fp", false, false), null)); return; } try { string seq = DbHelperOra.GetSingle("SELECT SEQ_FPKC.NEXTVAL FROM DUAL").ToString(); hfdBCode.Text = seq; List <CommandInfo> cmdList = new List <CommandInfo>(); cmdList.Add(new CommandInfo("UPDATE DAT_SL_DOC SET NUM1 = " + seq + " WHERE SEQNO IN (" + strBill.TrimEnd(',') + ")", null)); cmdList.Add(new CommandInfo("UPDATE DAT_CK_DOC SET NUM1 = " + seq + " WHERE SEQNO IN (" + strBill.TrimEnd(',') + ")", null)); OracleParameter[] parameters = { new OracleParameter("VIN_BILLNO", OracleDbType.Varchar2, 20), new OracleParameter("VIN_OPERUSER", OracleDbType.Varchar2, 800), new OracleParameter("VO_QHNUM", OracleDbType.Decimal) }; parameters[0].Value = hfdBCode.Text; parameters[1].Value = UserAction.UserID; parameters[0].Direction = ParameterDirection.Input; parameters[1].Direction = ParameterDirection.Input; parameters[2].Direction = ParameterDirection.Output; cmdList.Add(new CommandInfo("STOREDS.P_FP_AUTO", parameters, CommandType.StoredProcedure)); DbHelperOra.ExecuteSqlTran(cmdList); if (Convert.ToDecimal(parameters[2].Value.ToString()) > 0) { Alert.Show("波次[" + seq + "]自动分配成功!\n\r其中缺货明细[" + parameters[2].Value + "]条!"); } else { Alert.Show("波次[" + seq + "]自动分配成功!"); } OperLog("库存分配", "分配波次【" + seq + "】"); DataSearch(); } catch (Exception ex) { if (ex.Message.IndexOf("ORA-20001") > -1) { string msg = ex.Message.Substring(0, ex.Message.IndexOf("\n")); Alert.Show("自动分配失败,错误信息:\n\r\n\r " + msg.Substring(msg.IndexOf("ORA-20001") + 10), "错误信息", MessageBoxIcon.Warning); } else { Alert.Show("自动分配失败:\n\r\n\r " + ex.Message + "", "错误信息", MessageBoxIcon.Question); } } }
protected void btnSaveRefresh_Click(object sender, EventArgs e) { try { if (filePhoto.HasFile) { string sqlCmd = ""; sqlCmd = "select * from PLM_Product_OnLine where OrderId='" + Label_sn.Text + "'"; DataTable tmpDt = new DataTable(); SqlSel.GetSqlSel(ref tmpDt, sqlCmd); if (tmpDt.Rows.Count > 0)//如果当前产品已经排产过则提示是否继续操作 { string scriptString = Confirm.GetShowReference("当前产品已经下达过计划,是否继续安排生产计划?", string.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference("Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel")); PageContext.RegisterStartupScript(scriptString); } else { infoInsert(); } } else { Alert.ShowInTop("请上传相应的产品图片!"); return; } } catch (Exception ex) { Alert.ShowInTop(ex.Message); return; } }
protected void Bill_Audit(bool flag = true) { DataSave(); if (docFLAG.SelectedValue == "A") { if (DbHelperOra.Exists("select 1 from dat_db_com where xssl < 1 and seqno = '" + docSEQNO.Text + "'") && flag) { //Alert.Show("请首先进行库存分配,并确认调拨商品的批号信息不为空!", "提示信息", MessageBoxIcon.Warning); PageContext.RegisterStartupScript(Confirm.GetShowReference("此调拨单存在出库数量都为0的商品,是否继续?", "信息提示", MessageBoxIcon.Information, PageManager1.GetCustomEventReference(true, "Confirm_Fp", false, false), null)); return; } //验证库房是否盘点 if (DbHelperOra.Exists("SELECT 1 FROM DAT_PD_LOCK WHERE DEPTID IN('" + docDEPTOUT.SelectedValue + "','" + docDEPTID.SelectedValue + "') AND FLAG='N'")) { Alert.Show("库房正在盘点,请检查!"); return; } billLockDoc(true); //验证单据准确性 DataTable dt = DbHelperOra.QueryForTable("select dg.gdseq from dat_db_com dbc,doc_goods dg where dbc.gdseq=dg.gdseq and dg.islot='2' and nvl(dbc.ph,'#') ='#' and dbc.seqno='" + docSEQNO.Text + "'"); if (dt.Rows.Count > 0) { } if (BillOper(docSEQNO.Text, "AUDIT") == 1) { //if (!DbHelperOra.Exists("select 1 from dat_db_com where xssl < dhsl and seqno = '" + docSEQNO.Text + "'")) if (!DbHelperOra.Exists("select 1 from (select seqno,gdseq,sum(xssl) xssl,sum(dhsl) dhsl from dat_db_com group by seqno,gdseq,gdspec) a where a.xssl < a.dhsl and a.seqno = '" + docSEQNO.Text + "'")) { Alert.Show("调拨出库单【" + docSEQNO.Text + "】审核成功!"); } else { Alert.Show("调拨出库单【" + docSEQNO.Text + "】审核成功,库存不足商品自动生成缺货!"); } billOpen(docSEQNO.Text); OperLog("商品调拨", "审核单据【" + docSEQNO.Text + "】-调拨出库"); } } else { Alert.Show("调拨出库单【" + docSEQNO.Text + "】状态不正确", "提示信息", MessageBoxIcon.Warning); } }
private bool saveTest(string flag = "N") { List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList().ToList(); if (newDict.Count == 0) { Alert.Show("没有生成任何数据!", "消息提示", MessageBoxIcon.Information); return(false); } int rowIndex = 0; foreach (Dictionary <string, object> dic in newDict) { rowIndex++; if ((dic["YSSL"] ?? "0").ToString() == "0") { PageContext.RegisterStartupScript(Confirm.GetShowReference("第【" + rowIndex + "】行预算数量为空或0,确认执行操作?", "操作提示", MessageBoxIcon.Question, PageManager1.GetCustomEventReference("Confirm_OKSumbit"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); return(false); } } DataSave(flag); billSearch(); return(true); //SaveSuccess = true; }
protected override void billSave() { List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList().ToList(); if (newDict.Count == 0) { Alert.Show("没有生成任何数据!", "消息提示", MessageBoxIcon.Information); return; } int rowIndex = 0; foreach (Dictionary <string, object> dic in newDict) { rowIndex++; if ((dic["DHS"] ?? "0").ToString() == "0") { PageContext.RegisterStartupScript(Confirm.GetShowReference("第【" + rowIndex + "】行采购数量为空或0,确认执行操作?", "操作提示", MessageBoxIcon.Question, PageManager1.GetCustomEventReference("Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); return; } } DataSave(); billSearch(); }
//文档共享 //private void ShareDoc(string docId,bool shareStat) //{ // string stat = ""; // if (shareStat) // { // stat = "1"; // } // else // { // stat = "0"; // } // string sqlCmd = "update OA_DocMgmt_DocList set isShare='" + stat + "' where id=" + docId; // int exeCount = SqlSel.ExeSql(sqlCmd); // if (exeCount == 0) // { // Alert.ShowInTop("出错了!"); // return; // } //} protected void btn_Invalid_Click(object sender, EventArgs e) { //获取多选的行数 int selectedCount = Grid3.SelectedRowIndexArray.Length; if (selectedCount == 0) { Alert.ShowInTop("请先选择相应文件!"); return; } if (existInvalidDoc()) { PageContext.RegisterStartupScript(Confirm.GetShowReference("确认删除?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference("Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); } else { Alert.ShowInTop("已审核通过的文档不可删除,请查验!"); return; } }