public virtual int _GetUniqueIdentifier() { var hashCode = 399326290; hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (ImportId?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (ImportDate?.GetHashCode() ?? 0); return(hashCode); }
private void SaveWorkflowImportData() { List <string> itemsOnImport = new List <string>(); List <string> itemsAdded = new List <string>(); List <string> itemsCompleted = new List <string>(); List <string> importItemsInDB = new List <string>(); List <WorkflowItem> updateList = new List <WorkflowItem>(); int indx = 0; // edit WFM data foreach (WorkflowItem item in currentImportItems) { // add to new list updateList.Add(item); // edit if (updateList[indx].Status == "Completed/Trash" || updateList[indx].Status == "Completed" || updateList[indx].Status == "Trash") { updateList[indx].DisplayColor = "Gray"; updateList[indx].Note += $"<item added as completed/trash via DB Import {ImportDate.ToShortDateString()} > "; } else { updateList[indx].Note += $"<added via DB Import {ImportDate.ToShortDateString()}> "; } itemsOnImport.Add(updateList[indx].ToString()); ++indx; } // replace lists currentImportItems = updateList; // save items on import TotalItemsOnImport.AddRange(itemsOnImport); }
/// <summary> /// 查询运单信息 /// </summary> /// <param name="para"></param> public virtual void Search(SplashScreenManager splash) { splash.ShowWaitForm(); #region 拼接sql语句的where条件 string sqlWhere = $" tb_SFI_TrackNum.int_AGid={SelectedAgent.AGid}"; if (!string.IsNullOrWhiteSpace(OrderNo)) { if (OrderNo.IndexOf(",") > 0) { sqlWhere = $"{sqlWhere} AND tb_SFI_TrackNum.vchar_SFInum in ("; string[] strs = OrderNo.Split(','); foreach (string str in strs) { sqlWhere = $"{sqlWhere}'{str}',"; } sqlWhere = $"{sqlWhere.TrimEnd(',')})"; } else { sqlWhere = $"{sqlWhere} AND tb_SFI_TrackNum.vchar_SFInum='{OrderNo}'"; } } if (!string.IsNullOrWhiteSpace(AgentNo)) { if (AgentNo.IndexOf(",") > 0) { sqlWhere = $"{sqlWhere} AND tb_SFI_TrackNum.vchar_AGnum in ("; string[] strs = AgentNo.Split(','); foreach (string str in strs) { sqlWhere = $"{sqlWhere}'{str}',"; } sqlWhere = $"{sqlWhere.TrimEnd(',')})"; } else { sqlWhere = $"{sqlWhere} AND tb_SFI_TrackNum.vchar_AGnum='{OrderNo}'"; } } sqlWhere = $"{sqlWhere} AND CONVERT(varchar(10),tb_SFI_TrackNum.dttm_updateDttm,112) ='{ImportDate.ToString("yyyyMMdd")}'"; //string sqlSelect = $"SELECT tb_SFI_TrackNum.int_Mappingid AS 数据编号, tb_SFI_TrackNum.vchar_SFInum AS SFI单号,tb_SFI_TrackNum.vchar_AGnum AS 代理单号, (CONVERT(varchar(10),tb_SFI_TrackNum.int_AGid) + N'-' + tb_Agent.vchar_AGname) AS 代理名称, tb_SFI_TrackNum.dttm_updateDttm AS 数据导入时间, tb_SFI_TrackNum.dttm_AG_LastSyn AS 最后同步时间, tb_SFI_TrackNum.char_IsStop AS 运输服务完毕 FROM tb_SFI_TrackNum INNER JOIN tb_Agent ON tb_SFI_TrackNum.int_AGid = tb_Agent.int_AGid WHERE {sqlWhere} ORDER BY tb_SFI_TrackNum.dttm_updateDttm DESC"; string sqlSelect = $"SELECT tb_SFI_TrackNum.int_Mappingid, tb_SFI_TrackNum.vchar_SFInum,tb_SFI_TrackNum.vchar_AGnum , (CONVERT(varchar(10),tb_SFI_TrackNum.int_AGid) + N'-' + tb_Agent.vchar_AGname), tb_SFI_TrackNum.dttm_updateDttm, tb_SFI_TrackNum.dttm_AG_LastSyn, tb_SFI_TrackNum.char_IsStop FROM tb_SFI_TrackNum INNER JOIN tb_Agent ON tb_SFI_TrackNum.int_AGid = tb_Agent.int_AGid WHERE {sqlWhere} ORDER BY tb_SFI_TrackNum.dttm_updateDttm DESC"; //DataSet ds = SQLHelper.GetDataSet(sqlSelect); //if (ds != null && ds.Tables.Count == 1) //{ // //para.Grid.BeginUpdate(); // //para.Grid.DataSource = ds.Tables[0].DefaultView; // //para.Grid.EndUpdate(); //} var tracks = (SQLHelper.GetObject <SFITrackNum>(sqlSelect)).ToList(); trackNumInfos.Clear(); if (tracks.Count > 0) { foreach (SFITrackNum track in tracks) { trackNumInfos.Add(track); } } else { trackNumInfos.Clear(); } splash.CloseWaitForm(); #endregion }
public virtual void BatchSubmit(SplashScreenManager splash) { string clipboard = Clipboard.GetText(); DataTable dtInput = new DataTable(); DataRow nR; if (!clipboard.Contains((char)(10))) { XtraMessageBox.Show("复制的内容格式不正确", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (!clipboard.Contains((char)(9))) { XtraMessageBox.Show("复制的内容格式不正确", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } dtInput.Columns.Add("SFI单号"); dtInput.Columns.Add("代理单号"); string[] strs = clipboard.Split((char)(10)); string enter = ((char)13).ToString(); string tmpStr; foreach (string s in strs) { tmpStr = s.Replace(enter, ""); if (!string.IsNullOrEmpty(tmpStr)) { nR = dtInput.NewRow(); nR[0] = tmpStr.Split((char)(9))[0]; nR[1] = tmpStr.Split((char)(9))[1]; dtInput.Rows.Add(nR); } } InputDataFrm inputDataFrm = new InputDataFrm(dtInput, SelectedAgent.AGid); DialogResult DResult = inputDataFrm.ShowDialog(); if (DResult == DialogResult.OK) { splash.ShowWaitForm(); string sqlStr = $"select * from tb_SFI_TrackNum where int_AGid={SelectedAgent.AGid} AND CONVERT(varchar(10),tb_SFI_TrackNum.dttm_updateDttm,112) ='{ImportDate.ToString("yyyyMMdd")}';"; LoadNewAddedTrackNos(sqlStr); splash.CloseWaitForm(); } else if (DResult == DialogResult.Abort) { XtraMessageBox.Show("添加数据失败", "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (DResult == DialogResult.Cancel) { XtraMessageBox.Show("用户取消操作", "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public virtual void Submit(SplashScreenManager splash) { splash.ShowWaitForm(); ImportDate = DateTime.Now; AgentNo = string.Empty; OrderNo = string.Empty; if (string.IsNullOrWhiteSpace(OrderNo2)) { splash.CloseWaitForm(); XtraMessageBox.Show("订单号不能为空", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (string.IsNullOrWhiteSpace(AgentNo2)) { splash.CloseWaitForm(); XtraMessageBox.Show("DPD单号不能为空", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } string str = "0123456789"; string aGawbSign = ""; for (int i = AgentNo2.Length - 1; i >= 0; i += -1) { if (str.LastIndexOf(AgentNo2.Substring(i, 1)) != 0) { aGawbSign = AgentNo2.Substring(i, 1); break; } } if (string.IsNullOrWhiteSpace(aGawbSign)) { //获取最后一位的值 aGawbSign = AgentNo2.Substring(AgentNo2.Length - 2, 1); } string sqlStr = $"INSERT INTO tb_SFI_TrackNum (vchar_SFInum, vchar_AGnum, int_AGid, vchar_updateUser, dttm_updateDttm,char_AG_Syn_sign) VALUES ('{OrderNo2}','{AgentNo2}','{SelectedAgent.AGid}','{MainFrm.CurrentUser}',GETDATE(),'{aGawbSign}');"; sqlStr = $"{sqlStr} select * from tb_SFI_TrackNum where int_AGid={SelectedAgent.AGid} AND CONVERT(varchar(10),tb_SFI_TrackNum.dttm_updateDttm,112) ='{ImportDate.ToString("yyyyMMdd")}';"; IList <SFITrackNum> tracks = SQLHelper.GetObject <SFITrackNum>(sqlStr).ToList(); LoadNewAddedTrackNos(sqlStr); splash.CloseWaitForm(); }