public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); if (e.BarItemKey.Equals("")) { } }
/// <summary> /// 销售员货款,查看明细 /// </summary> /// <param name="e"></param> public override void EntryBarItemClick(BarItemClickEventArgs e) { base.EntryBarItemClick(e); string key = e.BarItemKey.ToUpperInvariant(); switch (key) { case "TBALLITEMS": //tbAllItems Act_ShowSellerDetail("0"); break; case "TBONEITEM": //tbOneItem DynamicObject rowData; int rowIndex; this.Model.TryGetEntryCurrentRow("FEntity", out rowData, out rowIndex); if (rowData != null) { string FSellerID = rowData == null ? "0" : (rowData["FSellerID"] as DynamicObject)["Id"].ToString(); Act_ShowSellerDetail(FSellerID); } else { this.View.ShowMessage("未选择有效的单据体行!"); } break; } }
public override void BarItemClick(BarItemClickEventArgs e) { string str2; base.BarItemClick(e); if (((str2 = e.BarItemKey.ToUpperInvariant()) != null) && (str2 == "TBBUMPSETTING")) { string id = base.View.BusinessInfo.GetForm().Id; if (!CommonHelper.CheckPermission(base.Context, id, "545c77b3761524")) { base.View.ShowMessage(ResManager.LoadKDString("您没有撞单设置的权限!", "006008030001275", SubSystemType.CRM, new object[0]), MessageBoxType.Notice); } else { BillShowParameter param = new BillShowParameter { FormId = "CRM_BumpAnalysisSetting", OpenStyle = { ShowType = ShowType.Modal }, PageId = SequentialGuid.NewGuid().ToString(), CustomParams = { { "FormID", id } }, CustomComplexParams = { { "EnableExpdate", false } } }; List <string> list = new string[] { "FBillHead", "FCRM_Clue_Cust", "FCRM_Clue_Contact" }.ToList <string>(); param.CustomComplexParams.Add("FormTables", list); base.View.ShowForm(param); } } }
public override void EntryBarItemClick(BarItemClickEventArgs e) { string barItemKey = e.BarItemKey; if (barItemKey != null) { if (barItemKey != "tbIgnoreMinus") { if (barItemKey != "tbIgnoreStkBillAudit") { if (barItemKey == "tbIgnoreStkBillDraft") { this.DoSingleAction("StkBillDraft"); } return; } } else { this.DoSingleAction("Minus"); return; } this.DoSingleAction("CntBillAudit"); } }
public override void BarItemClick(BarItemClickEventArgs e) { string barItemKey = e.BarItemKey; if (barItemKey != null) { if (barItemKey != "tbAction") { if (barItemKey != "tbErrDetail") { if (barItemKey == "tbExit") { this.View.Close(); } return; } } else { this.DoAction(); this.isClicked = true; return; } if (!this.bShowErr) { this.ShowErrTypeInfo(); } else { this.ShowErrGrid(false); } } }
public override void BarItemClick(BarItemClickEventArgs e) { //定义主键变量(用于收集所选中的行主键值) var fidlist = string.Empty; //订单退回操作 base.BarItemClick(e); //获取当前登录用户信息ID var currUserId = this.Context.UserId; //付款申请单(注:只有当前用户是‘易建青’才可以使用) if (e.BarItemKey == "tbPayApply" && currUserId == 680335) { //获取列表上通过复选框勾选的记录 var selectedRows = this.ListView.SelectedRowsInfo; //通过循环将选中行的主键进行收集 foreach (var row in selectedRows) { if (string.IsNullOrEmpty(fidlist)) { fidlist = Convert.ToString(row.PrimaryKeyValue); } else { fidlist += "," + Convert.ToString(row.PrimaryKeyValue); } } //根据所获取的单号进行更新 generate.UpdateK3Record(fidlist); //输出 View.ShowMessage("已完成更新"); } }
/// <summary> /// 顶部按钮点击事件 by: ly /// </summary> /// <param name="e"></param> public override void BarItemClick(BarItemClickEventArgs e) { if (this.View.ClientType.ToString() != "Mobile") { switch (e.BarItemKey.ToUpperInvariant()) { case "ALLOCBTN": //allocClue(); reAllocClue(); break; case "REALLOCBTN": break; case "TRANSFORMBTN": //PC端转化商机通过配置单据转换进行实现 if (!transformEnable()) { //如果线索关闭,直接返回 return; } break; case "CLOSEBTN": closeClue(); break; } } base.BarItemClick(e); }
public override void EntryBarItemClick(BarItemClickEventArgs e) { base.EntryBarItemClick(e); int rowIndex = this.Model.GetEntryCurrentRowIndex("FSaleOrderEntry"); decimal alldiscount = decimal.Parse(this.Model.GetValue("FALLdiscount").ToString());//本次折扣使用总金额 if (e.BarItemKey.Equals("tbDeleteLine")) { if (alldiscount == 0) { //逐行,删除单据体分录,0代表第1行 this.View.Model.DeleteEntryRow("FSaleOrderEntry", rowIndex); } DynamicObject fcustid = this.Model.GetValue("FCustId") as DynamicObject; if (fcustid == null) { return; } string custid = fcustid["Id"].ToString(); DynamicObject fmaterialid = this.Model.GetValue("FMaterialID", 0) as DynamicObject; if (fmaterialid != null && custid != "") { this.View.GetControl("FCustId").Enabled = false; this.View.GetControl("FSaleOrgId").Enabled = false; } else { this.View.GetControl("FCustId").Enabled = true; this.View.GetControl("FSaleOrgId").Enabled = true; } //刷新,单据体界面 this.View.UpdateView("FSaleOrderEntry"); } }
public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); if (e.BarItemKey == "tb_ImportFileUpdateEdit") { this.View.ShowMessage("测试成功!", MessageBoxType.Notice); } }
public override void BarItemClick(BarItemClickEventArgs e) { switch (e.BarItemKey.ToUpperInvariant()) { case "ORA_TBRELATION": //ora_tbRelation Act_RelationOrder(); break; } }
public override void EntryBarItemClick(BarItemClickEventArgs e) { base.EntryBarItemClick(e); if (!isResp()) { e.Cancel = true; this.View.ShowMessage("你没有操作的权限!"); } }
public override void EntryBarItemClick(BarItemClickEventArgs e) { base.EntryBarItemClick(e); switch (e.BarItemKey.ToString()) { case "tbViewPr": OpenPsnReportForm(); break; } }
public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); if (e.BarItemKey.Equals("tbSubmitBank")) { if (Convert.ToInt32(this.Model.GetValue("F_PAEZ_SFYQZF")) == 0) { throw new Exception("该单据没有勾选支持银企付款参数,不允许通过银企进行付款!"); } } }
/// <summary> /// 菜单点击事件,表单插件同样适用 /// </summary> /// <param name="e"></param> public override void BarItemClick(BarItemClickEventArgs e) { switch (e.BarItemKey.ToUpperInvariant()) { case "TBVIEW": //tbView 打开 Act_OpenCust(); break; default: break; } }
public override void BarItemClick(BarItemClickEventArgs e) { if (e.BarItemKey == "tbButton") { string s1 = this.View.Model.GetValue("F_QRSR_Text").ToString(); string s2 = this.View.Model.GetValue("FBILLNO").ToString(); // SqlConnectionStringBuilder scsb = new SqlConnectionStringBuilder(); /* scsb.DataSource = "127.0.0.1"; * scsb.UserID = "sa"; ; * scsb.Password = "******"; * scsb.InitialCatalog = "hello"; * * SqlConnection conn = new SqlConnection(scsb.ToString()); * conn.Open(); * string sql = "insert into Table1 values('"+s2+"','"+s1+"')"; * SqlCommand cmd = new SqlCommand(sql, conn); * int count = cmd.ExecuteNonQuery();*/ string strConnection = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.10) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME= ORCL)));User Id=DUPM123;Password=dupm123"; string str_sql = "insert into Table1 values('" + s2 + "','" + s1 + "')"; OracleConnection conn = new OracleConnection(strConnection); conn.Open(); OracleCommand cmd1 = new OracleCommand(str_sql, conn); int count = cmd1.ExecuteNonQuery(); conn.Close(); if (count > 0) { this.View.ShowMessage("保存成功"); } /* * if (e.BarItemKey == "tbButton") * { * String id = this.View.Model.GetValue("FBillNo").ToString(); * string pass = this.View.Model.GetValue("F_WWW_Text").ToString(); * * String constr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.10) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME= ORCL)));User Id=DUPM123; Password=dupm123"; * OracleConnection conn = new OracleConnection(constr); * conn.Open(); * * string findstr = "insert into Table1 values(" + id+",'"+ pass+ "')"; * //SqlCommand sqlda = new SqlCommand(findstr, conn);sql server * OracleCommand orada = new OracleCommand(findstr, conn); * int Succnum = orada.ExecuteNonQuery(); * //结果集保存 * conn.Close(); * this.View.ShowMessage(Succnum.ToString()); * } */ } }
/// <summary> /// 菜单点击事件,表单插件同样适用 /// </summary> /// <param name="e"></param> public override void BarItemClick(BarItemClickEventArgs e) { switch (e.BarItemKey.ToUpperInvariant()) { //case "TBDELETE": 列表工具栏按钮事件,通过按钮Key[大写]来区分那个按钮事件 //break; case "": break; default: break; } }
public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); if (e.BarItemKey == "tbButton_1") { String str1 = this.Model.GetValue("F_WWW_Text").ToString(); String constr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME= ORCL)));User Id=system; Password=123456"; OracleConnection conn = new OracleConnection(constr); conn.Open(); string findstr = "delete from notes where id = '" + str1 + "'"; OracleCommand orada = new OracleCommand(findstr, conn); int number = orada.ExecuteNonQuery(); this.View.ShowMessage("反审核成功" + number); } }
public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); switch (e.BarItemKey) { case "tbModifySalOrder": ExecutOperate(this.Context, RequestType.MODIFY); break; case "tbCombineSalOrder": ExecutOperate(this.Context, RequestType.COMBINE); break; } }
public override void BarItemClick(BarItemClickEventArgs e) { //订单退回操作 base.BarItemClick(e); var resultMessage = string.Empty; //删除U订货单据(除退款单外使用) if (e.BarItemKey == "tbDelUOrderR") { //定义获取表头信息对像 var docScddIds1 = View.Model.DataObject; //获取表头中单据编号信息(注:这里的BillNo为单据编号中"绑定实体属性"项中获得) var dhstr = docScddIds1["BillNo"].ToString(); fcy.Service.CnnStr = "http://172.16.4.252/websys/service.asmx"; fcy.Service.userdmstr = "feng"; fcy.Service.passwordstr = ""; //将获取的单据名称进行截取,取前两位 var orderno = dhstr.Substring(0, 2); //根据获取的标记分别进行单据删除 switch (orderno) { //其他应收单 case "QT": resultMessage = DelReturnOrder(dhstr); break; //收款退款单 case "SK": resultMessage = DelReturnOrder(dhstr); break; //应收单 case "AR": resultMessage = DelReturnOrder(dhstr); //更新应收单F_YTC_COMBO=0 //UpdateK3(dhstr); break; } //输出结果 View.ShowMessage(resultMessage); } }
public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); switch (e.BarItemKey.ToLower()) { case "tbsplitsave": case "tbsave": object objCreator = this.Model.GetValue("F_PAE_Creator"); if (objCreator.IsNullOrEmptyOrWhiteSpace()) { this.View.ShowErrMessage("对不起,创建人不能为空"); e.Cancel = true; } break; } }
public override void BarItemClick(BarItemClickEventArgs e) { if (e.BarItemKey.ToUpper() == "TBBUTTON") { string s1 = this.View.Model.GetValue("F_QRSR_TEXT").ToString(); string s2 = this.View.Model.GetValue("F_QRSR_TEXT1").ToString(); string s3 = this.View.Model.GetValue("F_QRSR_TEXT2").ToString(); string s4 = this.View.Model.GetValue("F_QRSR_TEXT3").ToString(); string strConnection = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME= ORCL)));User Id=system;Password=Zzw19970418"; string str_sql = "insert into test02 values('" + s1 + "','" + s2 + "','" + s3 + "','" + s4 + "')"; OracleConnection conn = new OracleConnection(strConnection); conn.Open(); OracleCommand cmd1 = new OracleCommand(str_sql, conn); int count = cmd1.ExecuteNonQuery(); conn.Close(); if (count > 0) { this.View.ShowMessage("保存成功"); } } }
public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); switch (e.BarItemKey) { case "tbPlaceOrderFedx": //SaveLogisticsLocus(this.Context); List <DeliveryNotice> notices = GetDeliveryNotices(this.Context); HttpResponseResult result = null; Dictionary <string, Object> dict = ShipWebService.GetLogisticsDetail <Object>(this.Context, notices); foreach (var item in dict) { if (item.Key.CompareTo("notices") == 0) { notices = (List <DeliveryNotice>)item.Value; } if (item.Key.CompareTo("result") == 0) { result = (HttpResponseResult)item.Value; } } SaveLogisticsTrace(this.Context, notices); UpdateShipment(this.Context, notices); //ShowMessage(this.Context, result); DynamicFormShowParameter showParam = new DynamicFormShowParameter(); showParam.CustomParams.Add("trackingNumber", JsonConvert.SerializeObject(GetCarryNos(notices))); showParam.FormId = "HS_SELECTPRINTER"; this.View.ShowForm(showParam); //SaveLogisticsLocus(this.Context,notices); break; } }
/* * 触发时机: * 主菜单单击时触发 * * 应用场景: * 通常动态表单在设计时主菜单都会配置平台内置提供的服务,有时有些用户可能需要在调用平台内置功能前进行权限验证、数据检查等等,用户也可以在该事件中通过添加e.Cancel=true取消平台内置功能,完全自定义处理逻辑. * * 案例演示: * 添加菜单按钮,点击后保存当前单据 * 点击复制按钮时,已禁用的记录禁止复制 * 添加菜单按钮,弹出消息框显示所有仓库的名称 */ public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); switch (e.BarItemKey) { //添加菜单按钮,点击后保存当前单据 case "tbSaveTest": var result = BusinessDataServiceHelper.Save(this.Context, this.View.BillBusinessInfo, this.Model.DataObject); if (result.IsSuccess) { this.View.ShowMessage("单据保存成功!"); this.Model.DataChanged = false; } return; //点击复制按钮时,已禁用的记录禁止复制 case "tbCopy": var fieldValue = this.Model.GetValue("FForbidStatus"); if (fieldValue != null && fieldValue.ToString() == "B") { this.View.ShowMessage("当前数据已被禁用,禁止复制!"); e.Cancel = true; } return; //弹出消息框显示所有仓库的名称 case "tbQueryStock": var selectItems = SelectorItemInfo.CreateItems("FName"); var dyList = BusinessDataServiceHelper.Load(this.View.Context, "BD_STOCK", selectItems, null); var warehouseNameList = new List <string>(); foreach (var dy in dyList) { warehouseNameList.Add(dy["Name"].ToString()); } this.View.ShowMessage("仓库名称:" + string.Join(",", warehouseNameList)); return; } }
public override void BarItemClick(BarItemClickEventArgs e) { //订单退回操作 base.BarItemClick(e); //关闭U订货对应订单明细行 if (e.BarItemKey == "tbCloseUOrder") { //定义获取表头信息对像 var docScddIds1 = View.Model.DataObject; //获取表头中单据编号信息(注:这里的BillNo为单据编号中"绑定实体属性"项中获得) var dhstr = docScddIds1["BillNo"].ToString(); fcy.Service.CnnStr = "http://172.16.4.252/websys/service.asmx"; fcy.Service.userdmstr = "feng"; fcy.Service.passwordstr = ""; var resultMessage = FcyUdhPosts.Ddclose(dhstr, "1"); //输出结果 View.ShowMessage(resultMessage); } }
public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); if (e.BarItemKey == "tbButton") { String id = this.View.Model.GetValue("FBillNo").ToString(); string pass = this.View.Model.GetValue("F_WWW_Text").ToString(); // string constr = "server=.;database=ddd;uid=sa;pwd=123"; // SqlConnection sqlc = new SqlConnection(constr); // sqlc.Open(); String constr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.10) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME= ORCL)));User Id=DUPM123; Password=dupm123"; OracleConnection conn = new OracleConnection(constr); conn.Open(); string findstr = "insert into Table1 values(" + id + ",'" + pass + "')"; //SqlCommand sqlda = new SqlCommand(findstr, conn);sql server OracleCommand orada = new OracleCommand(findstr, conn); int Succnum = orada.ExecuteNonQuery(); //结果集保存 conn.Close(); this.View.ShowMessage(Succnum.ToString()); } }
public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); if (e.BarItemKey.Equals("tbSubmitBank")) { QueryBuilderParemeter queryParam = new QueryBuilderParemeter(); queryParam.FormId = this.View.BillBusinessInfo.GetForm().Id; queryParam.BusinessInfo = this.View.BillBusinessInfo; queryParam.SelectItems.Add(new SelectorItemInfo("F_PAEZ_SFYQZF")); List <long> billIds = (from p in this.ListView.SelectedRowsInfo select Convert.ToInt64(p.PrimaryKeyValue)).ToList(); queryParam.FilterClauseWihtKey = string.Format(" {0} IN ( {1} ) ", this.ListView.BillBusinessInfo.GetForm().PkFieldName, string.Join(",", billIds)); var rows = QueryServiceHelper.GetDynamicObjectCollection(this.Context, queryParam); List <Boolean> result = (from z in rows.Where(z => !Convert.ToBoolean(z["F_PAEZ_SFYQZF"])) select Convert.ToBoolean(z["F_PAEZ_SFYQZF"])).ToList(); if (result.Count() > 0) { throw new Exception("所选单据存在没有勾选支持银企付款参数,不允许通过银企进行付款!"); } } }
public override void BarItemClick(BarItemClickEventArgs e) { var resultMessage = string.Empty; //订单退回操作 base.BarItemClick(e); if (e.BarItemKey == "tbUpLoadOrder") { //定义获取表头信息对像 var docScddIds1 = View.Model.DataObject; //获取表头中单据编号信息(注:这里的BillNo为单据编号中"绑定实体属性"项中获得) var dhstr = docScddIds1["BillNo"].ToString(); fcy.Service.CnnStr = "http://172.16.4.252/websys/service.asmx"; fcy.Service.userdmstr = "feng"; fcy.Service.passwordstr = ""; //将获取的单据名称进行截取,取前两位 var orderno = dhstr.Substring(0, 2); //根据获取的标记分别进行单据上传至U订货相关单据 switch (orderno) { //应收单 case "AR": resultMessage = UploadOrder(dhstr); break; //收款退款单 case "SK": resultMessage = SkUpload(dhstr); break; } //输出结果 View.ShowMessage(resultMessage); } }
public override void BarItemClick(BarItemClickEventArgs e) { //处理无上游无对应销售订单 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "NoUpStream", StringComparison.CurrentCultureIgnoreCase)) { if (!check("无对应销售订单")) { return; } //删除对应错误信息表中的数据 string filter = getSelectedRowsElements("fid"); string strSql = string.Format(@"/*dialect*/ Delete Allocationtable where fid in ({0})", filter); DBUtils.Execute(this.Context, strSql); //将接口待处理表对应数据状态置为0 等待抽数接口检查 filter = getSelectedRowsElements("FBILLNO"); strSql = string.Format(@"/*dialect*/ Update altablein set status=0 where id in ({0})", filter); DBUtils.Execute(this.Context, strSql); } //处理物料启用BOM管理,但是销售订单中未选中BOM版本 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "NoBom", StringComparison.CurrentCultureIgnoreCase)) { if (!check("物料启用BOM管理,但是销售订单中未选中BOM版本")) { return; } //删除对应错误信息表中的数据 string filter = getSelectedRowsElements("fid"); string strSql = string.Format(@"/*dialect*/ Delete Allocationtable where fid in ({0})", filter); DBUtils.Execute(this.Context, strSql); //将接口待处理表对应数据状态置为0 等待抽数接口检查 filter = getSelectedRowsElements("FBILLNO"); strSql = string.Format(@"/*dialect*/ Update altablein set status=0 where id in ({0})", filter); DBUtils.Execute(this.Context, strSql); } //重新审核 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "ReAudit", StringComparison.CurrentCultureIgnoreCase)) { if (!check("ReAudit")) { return; } //预检前端选择数据 if (!checkData("ReAudit")) { return; } //删除对应错误信息表中的数据 string filter = getSelectedRowsFErrorBillNo("FErrorBillNo"); string filterid = getSelectedRowsElements("fid");//出库接口使用清除更新库存不成功报错的按钮时,大于可出库数量的报错也会随之被清除, string strSql = string.Format(@"/*dialect*/ Delete Allocationtable where fid in ({0}) ", filterid); DBUtils.Execute(this.Context, strSql); //将接口待处理表对应数据状态置为5 3D业务人员手工审核成功 strSql = string.Format(@"/*dialect*/ Update altablein set status=5,ferrormsg='3D业务人员手工审核成功',fsubdate=GETDATE() where fbillno in ({0}) and status=2", filter); DBUtils.Execute(this.Context, strSql); } //处理采购件无对应仓库 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "NoStock", StringComparison.CurrentCultureIgnoreCase)) { if (!check("采购件无对应仓库")) { return; } //删除对应错误信息表中的数据 string filter = getSelectedRowsElements("fid"); string strSql = string.Format(@"/*dialect*/ Delete Allocationtable where fid in ({0})", filter); DBUtils.Execute(this.Context, strSql); //将接口待处理表对应数据状态置为0 等待抽数接口检查 filter = getSelectedRowsElements("FBILLNO"); strSql = string.Format(@"/*dialect*/ Update altablein set status=0,isPur=0 where id in ({0})", filter); DBUtils.Execute(this.Context, strSql); } //物料未维护生产车间 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "NoProduction", StringComparison.CurrentCultureIgnoreCase)) { if (!check("物料未维护生产车间")) { return; } //删除对应错误信息表中的数据 string filter = getSelectedRowsElements("fid"); string strSql = string.Format(@"/*dialect*/ Delete Allocationtable where fid in ({0})", filter); DBUtils.Execute(this.Context, strSql); //将接口待处理表对应数据状态置为0 等待抽数接口检查 filter = getSelectedRowsElements("FBILLNO"); strSql = string.Format(@"/*dialect*/ Update altablein set status=0 where id in ({0})", filter); DBUtils.Execute(this.Context, strSql); } //tbnoBillStaus5 //查询状态为5的,未生成单据号,单据号为空 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbnoBillStaus5", StringComparison.CurrentCultureIgnoreCase)) { string strSql = string.Format(@"/*dialect*/ update altablein set status=0 where status=5 and fbillno=' ' and id not in ( select atl.id from altablein atl left join ( select spinentry.FSALENUMBER,spinentry.FLINENUMBER,spin.FBILLNO from T_SP_INSTOCK spin inner join T_SP_INSTOCKentry spinentry on spin.FID= spinentry.fid ) b on atl.salenumber=b.FSALENUMBER and atl.linenumber=b.FLINENUMBER where atl.status=5 and atl.fbillno=' ' and b.FBILLNO is not null ) "); DBUtils.Execute(this.Context, strSql); } //挂起 // tbGQ if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbGQ", StringComparison.CurrentCultureIgnoreCase)) { //获取选中行 ListSelectedRowCollection selectRows = this.ListView.SelectedRowsInfo; //检查选中行数 if (selectRows.Count() < 1) { this.View.ShowErrMessage("请至少选中一条数据!"); return; } string filter = getSelectedRowsFErrorBillNo("fid"); string strSql = string.Format(@"/*dialect*/ update Allocationtable set FErrorBillNo='挂起' where fid in ({0})", filter); DBUtils.Execute(this.Context, strSql); } //反挂起 // tbfGQ if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbfGQ", StringComparison.CurrentCultureIgnoreCase)) { //获取选中行 ListSelectedRowCollection selectRows = this.ListView.SelectedRowsInfo; //检查选中行数 if (selectRows.Count() < 1) { this.View.ShowErrMessage("请至少选中一条数据!"); return; } string filter = getSelectedRowsFErrorBillNo("fid"); string strSql = string.Format(@"/*dialect*/ update Allocationtable set FErrorBillNo=' ' where fid in ({0})", filter); DBUtils.Execute(this.Context, strSql); } // //清除按钮:采购件无对应仓库、物料未维护生产车间、无对应销售订单,A,B,C 表清楚掉;问题错误表对应删掉 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbDELCQRK", StringComparison.CurrentCultureIgnoreCase)) { //删除 调拨错误信息表数据 string strSql = string.Format(@"/*dialect*/ delete Allocationtable where FBILLNO in ( select id from altablein where ferrormsg in ('采购件无对应仓库','无对应销售订单','物料未维护生产车间') and fbillno=' ' and status=2 ) "); DBUtils.Execute(this.Context, strSql); // 删除 调拨 B表 string strSql2 = string.Format(@"/*dialect*/ delete altable from altablein c where c.Salenumber=altable.Salenumber and c.Linenumber=altable.Linenumber and c.ferrormsg in ('采购件无对应仓库','无对应销售订单','物料未维护生产车间') and c.fbillno=' ' and c.status=2 "); DBUtils.Execute(this.Context, strSql2); // 删除 调拨 C表 string strSql3 = string.Format(@"/*dialect*/ delete from altablein where ferrormsg in ('采购件无对应仓库','无对应销售订单','物料未维护生产车间') and fbillno=' ' and status=2 "); DBUtils.Execute(this.Context, strSql3); } //重置按钮:调拨C表中的状态为1,只生成简单生产入库单状态为审核中 调整设置为 0 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbStatus1", StringComparison.CurrentCultureIgnoreCase)) { //重置 为0 将不是处理中的数据,处理日期不是当天的代表进程已经卡死了 string strSql = string.Format(@"/*dialect*/ update altablein set status=0 where status=1 and Fsubdate+0.5<getdate() and fbillno = ' ' "); DBUtils.Execute(this.Context, strSql); // 重置 未生成简单生产入库 如果生成请先删除掉 string strSql2 = string.Format(@"/*dialect*/ update altablein set status=0 where status=1 and Fsubdate+0.5<getdate() and fbillno not in ( select fbillno from T_SP_INSTOCK ) and fbillno like 'JDSC%' "); DBUtils.Execute(this.Context, strSql2); // 重置 未生成直接调拨单 如果生成请先删除掉 string strSql3 = string.Format(@"/*dialect*/ update altablein set status=0 where status=1 and Fsubdate+0.5<getdate() and fbillno not in ( select fbillno from T_STK_STKTRANSFERIN ) and fbillno like 'ZJDB%' "); DBUtils.Execute(this.Context, strSql3); } // tbgz 45 问题45 ,销售订单单号为:8885449,第3行,异常列表无报错,调拨单未生成,入库C表中报采购件无对应仓库的错(8885792第2行) if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbgz", StringComparison.CurrentCultureIgnoreCase)) { //删除 错误信息表对应的数据 string strSql = string.Format(@"/*dialect*/ delete from Allocationtable where fbillno in ( select id from altablein where status=2 and fbillno=' ' and ferrormsg like '%关账%' ) "); DBUtils.Execute(this.Context, strSql); // 重置 状态 为 0 string strSql2 = string.Format(@"/*dialect*/ update altablein set status=0 where status=2 and fbillno=' ' and ferrormsg like '%关账%' "); DBUtils.Execute(this.Context, strSql2); //lc 201911/14 add string strSql3 = string.Format(@"/*dialect*/ delete from Allocationtable where fbillno in ( select id from altablein where status in (2,5) and fbillno<>' ' and ferrormsg like '%关账%' ) "); DBUtils.Execute(this.Context, strSql3); } //大于可调拨数量 重新抽取 tbdykdb //清除按钮:大于可调拨数量,重新抽取 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbdykdb", StringComparison.CurrentCultureIgnoreCase)) { //获取选中行 ListSelectedRowCollection selectRows = this.ListView.SelectedRowsInfo; //检查选中行数 if (selectRows.Count() < 1) { this.View.ShowErrMessage("请至少选中一条数据!"); return; } // 删除 调拨 B 表 string filter = getSelectedRowsElements("FBILLNO"); //lc 20200206 去掉 //string strSql2 = string.Format(@"/*dialect*/ delete altable from altablein c where c.Salenumber=altable.Salenumber and c.Linenumber=altable.Linenumber and c.ferrormsg in ('大于可调拨数量') and c.status=2 and c.id in ({0}) ", filter); //DBUtils.Execute(this.Context, strSql2); // 删除 调拨 C表 //string strSql3 = string.Format(@"/*dialect*/ delete altablein where ferrormsg in ('大于可调拨数量') and status=2 and id in ({0}) ", filter ); // DBUtils.Execute(this.Context, strSql3); //删除 调拨错误信息表数据 filter = getSelectedRowsFErrorBillNo("fid"); string strSql = string.Format(@"/*dialect*/ delete from Allocationtable where REASON in ('大于可调拨数量') and fid in ({0}) ", filter); DBUtils.Execute(this.Context, strSql); } //20200320 删除关账错误数据 lcadd if (string.Equals(e.BarItemKey.ToUpperInvariant(), "btndelcloseGZ", StringComparison.CurrentCultureIgnoreCase)) { string strSql = string.Format(@"/*dialect*/ delete from Deliverytable where reason like '%关账%' "); DBUtils.Execute(this.Context, strSql); } this.View.Refresh(); }
public override void BarItemClick(BarItemClickEventArgs e) { //处理无上游无对应销售订单 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "NoUpStream", StringComparison.CurrentCultureIgnoreCase)) { if (!check("无对应销售订单")) { return; } //删除对应错误信息表中的数据 string filter = getSelectedRowsElements("fid"); string strSql = string.Format(@"/*dialect*/ Delete Deliverytable where fid in ({0})", filter); DBUtils.Execute(this.Context, strSql); //将接口待处理表对应数据状态置为0 等待抽数接口检查 filter = getSelectedRowsElements("FBILLNO"); strSql = string.Format(@"/*dialect*/ Update detablein set status=0 where id in ({0})", filter); DBUtils.Execute(this.Context, strSql); } //处理物料启用BOM管理,但是销售订单中未选中BOM版本 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "NoBom", StringComparison.CurrentCultureIgnoreCase)) { if (!check("物料启用BOM管理,但是销售订单中未选中BOM版本")) { return; } //删除对应错误信息表中的数据 string filter = getSelectedRowsElements("fid"); string strSql = string.Format(@"/*dialect*/ Delete Deliverytable where fid in ({0})", filter); DBUtils.Execute(this.Context, strSql); //将接口待处理表对应数据状态置为0 等待抽数接口检查 filter = getSelectedRowsElements("FBILLNO"); strSql = string.Format(@"/*dialect*/ Update detablein set status=0 where id in ({0})", filter); DBUtils.Execute(this.Context, strSql); } //重新审核 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "ReAudit", StringComparison.CurrentCultureIgnoreCase)) { if (!check("更新库存出现异常情况,更新库存不成功!")) { return; } //预检前端选择数据 if (!checkData("ReAudit")) { return; } //删除对应错误信息表中的数据 string filter = getSelectedRowsFErrorBillNo("FErrorBillNo"); string filterid = getSelectedRowsElements("fid"); string strSql = string.Format(@"/*dialect*/ Delete Deliverytable where fid in ({0}) ", filterid); DBUtils.Execute(this.Context, strSql); //将接口待处理表对应数据状态置为5 3D业务人员手工审核成功 strSql = string.Format(@"/*dialect*/ Update detablein set status=5,ferrormsg='3D业务人员手工审核成功',fsubdate=GETDATE() where fbillno in ({0}) and status=2 ", filter); DBUtils.Execute(this.Context, strSql); } //大于可出库数量 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "OverOutStockQua", StringComparison.CurrentCultureIgnoreCase)) { if (!check("大于可出库数量")) { return; } //预检前端选择数据 if (!checkData("OverOutStockQua")) { return; } //删除对应错误信息表中的数据 ListSelectedRowCollection selectRows = this.ListView.SelectedRowsInfo; for (int i = 0; i < selectRows.Count(); i++) { string strSql = string.Format(@"/*dialect*/Delete Deliverytable where Salenumber='{0}' and Linenumber='{1}'", Convert.ToString(selectRows[i].DataRow["FSalenumber"]), Convert.ToString(selectRows[i].DataRow["FLinenumber"])); DBUtils.Execute(this.Context, strSql); strSql = string.Format(@"/*dialect*/Delete detablein where Salenumber='{0}' and Linenumber='{1}'", Convert.ToString(selectRows[i].DataRow["FSalenumber"]), Convert.ToString(selectRows[i].DataRow["FLinenumber"])); DBUtils.Execute(this.Context, strSql); strSql = string.Format(@"/*dialect*/Delete detable where Salenumber='{0}' and Linenumber='{1}'", Convert.ToString(selectRows[i].DataRow["FSalenumber"]), Convert.ToString(selectRows[i].DataRow["FLinenumber"])); DBUtils.Execute(this.Context, strSql); } } //lc add 查询状态为5的,未生成单据号,单据号为空 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbstatusnobill", StringComparison.CurrentCultureIgnoreCase)) { string strSql = string.Format(@"/*dialect*/ update detablein set status=0 where status=5 and ( fbillno=' ' or fbillno='0' ) and not id in ( select detl.id from detablein detl, (select c.FSRCBILLNO,a.FSRCBILLSEQ from T_SAL_OUTSTOCKENTRY a inner join T_SAL_OUTSTOCK b on a.FID=b.fid left join T_SAL_OUTSTOCKENTRY_R c on a.FENTRYID=c.FENTRYID ) outbill where detl.status=5 and detl.fbillno=' ' and detl.Salenumber=outbill.FSRCBILLNO and detl.Linenumber=outbill.FSRCBILLSEQ ) "); DBUtils.Execute(this.Context, strSql); } // lc tbOutStatus5 这些已经生成出库单 状态设置为5 错误信息表也删掉; if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbOutStatus5", StringComparison.CurrentCultureIgnoreCase)) { //先删除 出库错误信息表 string strSql = string.Format(@"/*dialect*/ delete from Deliverytable where DETABLEINID in ( select id from detablein din left join (select c.FSRCBILLNO,a.FSRCBILLSEQ,b.FBILLNO from T_SAL_OUTSTOCKENTRY a inner join T_SAL_OUTSTOCK b on a.FID=b.fid left join T_SAL_OUTSTOCKENTRY_R c on a.FENTRYID=c.FENTRYID ) b on din.Salenumber=b.FSRCBILLNO and din.Linenumber=b.FSRCBILLSEQ where din.status=2 and din.ferrormsg='大于可出库数量' and b.FBILLNO is not null ) "); DBUtils.Execute(this.Context, strSql); strSql = string.Format(@"/*dialect*/ update detablein set status=5 where id in ( select din.id from detablein din left join (select c.FSRCBILLNO,a.FSRCBILLSEQ,b.FBILLNO from T_SAL_OUTSTOCKENTRY a inner join T_SAL_OUTSTOCK b on a.FID=b.fid left join T_SAL_OUTSTOCKENTRY_R c on a.FENTRYID=c.FENTRYID ) b on din.Salenumber=b.FSRCBILLNO and din.Linenumber=b.FSRCBILLSEQ where din.status=2 and din.ferrormsg='大于可出库数量' and b.FBILLNO is not null ) "); DBUtils.Execute(this.Context, strSql); } //挂起 // tbGQ if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbGQ", StringComparison.CurrentCultureIgnoreCase)) { //获取选中行 ListSelectedRowCollection selectRows = this.ListView.SelectedRowsInfo; //检查选中行数 if (selectRows.Count() < 1) { this.View.ShowErrMessage("请至少选中一条数据!"); return; } string filter = getSelectedRowsFErrorBillNo("fid"); string strSql = string.Format(@"/*dialect*/ update Deliverytable set FErrorBillNo='挂起' where fid in ({0})", filter); DBUtils.Execute(this.Context, strSql); } // tbGQ 反挂起 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbfGQ", StringComparison.CurrentCultureIgnoreCase)) { //获取选中行 ListSelectedRowCollection selectRows = this.ListView.SelectedRowsInfo; //检查选中行数 if (selectRows.Count() < 1) { this.View.ShowErrMessage("请至少选中一条数据!"); return; } string filter = getSelectedRowsFErrorBillNo("fid"); string strSql = string.Format(@"/*dialect*/ update Deliverytable set FErrorBillNo=' ' where fid in ({0})", filter); DBUtils.Execute(this.Context, strSql); } //清除按钮:采购件无对应仓库、物料未维护生产车间、无对应销售订单,A,B,C 表清楚掉;问题错误表对应删掉 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbDELCQRK", StringComparison.CurrentCultureIgnoreCase)) { //删除 出库错误信息表数据 string strSql = string.Format(@"/*dialect*/ delete Deliverytable where FBILLNO in ( select id from detablein where ferrormsg in('采购件无对应仓库','无对应销售订单','物料未维护生产车间') and status=2 ) "); DBUtils.Execute(this.Context, strSql); // 删除 出库 B表 string strSql2 = string.Format(@"/*dialect*/ delete detable from detablein c where c.Salenumber=detable.Salenumber and c.Linenumber=detable.Linenumber and c.ferrormsg in('物料未维护生产车间','无对应销售订单') and c.status=2 "); DBUtils.Execute(this.Context, strSql2); // 删除 出库 C表 string strSql3 = string.Format(@"/*dialect*/ delete from detablein where ferrormsg in('采购件无对应仓库','无对应销售订单','物料未维护生产车间') and status=2 "); DBUtils.Execute(this.Context, strSql3); } //重置按钮:无对应销售订单:81700101-00504-0 出库C表状态为1 无出库单生成 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "tbStatus1", StringComparison.CurrentCultureIgnoreCase)) { //重置 为0 将不是处理中的数据,处理日期不是当天的代表进程已经卡死了 string strSql = string.Format(@"/*dialect*/ update detablein set status=0 where status =1 and Fsubdate+0.5<getdate() and ( fbillno=' ' or fbillno='0' ) "); DBUtils.Execute(this.Context, strSql); // 重置 未生成出库单 如果生成请先删除掉 string strSql2 = string.Format(@"/*dialect*/ update detablein set status=0 where status =1 and Fsubdate+0.5<getdate() and fbillno not in ( select fbillno from T_SAL_OUTSTOCK ) and fbillno like 'XSCK%' "); DBUtils.Execute(this.Context, strSql2); } //20200320 删除关账错误数据 lcadd if (string.Equals(e.BarItemKey.ToUpperInvariant(), "btndelcloseGZ", StringComparison.CurrentCultureIgnoreCase)) { string strSql = string.Format(@"/*dialect*/ delete from Deliverytable where reason like '%关账%' "); DBUtils.Execute(this.Context, strSql); } // 重置 辅助属性错误的 设置状态为0 辅助属性错误数据重置0 add lc 20200409 if (string.Equals(e.BarItemKey.ToUpperInvariant(), "btnresetFz", StringComparison.CurrentCultureIgnoreCase)) { //获取选中行 ListSelectedRowCollection selectRows = this.ListView.SelectedRowsInfo; //检查选中行数 if (selectRows.Count() < 1) { this.View.ShowErrMessage("请至少选中一条数据!"); return; } // 辅助属性错误的 设置状态为0 string filter = getSelectedRowsElements("FBILLNO"); string strSql = string.Format(@"/*dialect*/ Update detablein set status=0 , FErrorStatus =0 ,ferrormsg ='' where ferrormsg like '%辅助属性不能为空%' and id in ({0}) and status=2 ", filter); DBUtils.Execute(this.Context, strSql); // delete from Deliverytable where REASON like '%辅助属性%' string strSql2 = string.Format(@"/*dialect*/ delete from Deliverytable where REASON like '%辅助属性%' and FBILLNO in ({0}) ", filter); DBUtils.Execute(this.Context, strSql2); } this.View.Refresh(); }
public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); }