public void DoView(bool hideribbon=false,bool useoother=false,string concomp = "") { if (!string.IsNullOrEmpty(_tranid)) { var bl = new Blitemmove { Tranid = _tranid }; bl.GetItemMoveByTranid(useoother,concomp); bsW.Filter = ""; txtpurno.Text = _tranid; dateEdit1.EditValue = bl.Trandate; lookupfrom.EditValue = bl.FromId; lookupto.EditValue = bl.ToId; memoEdit1.EditValue = bl.Notes; ShorcutKeysDisbale = !bl.Hold; if (dsInventory1.ITEMTRANSFERDETAIL.Rows.Count > 0) { dsInventory1.ITEMTRANSFERDETAIL.Clear(); dsInventory1.Merge(bl.Itemtransferdetail); } else { dsInventory1.Merge(bl.Itemtransferdetail); } if(!bl.Hold) { SaveButtonEnable = false; SaveandNewButtonEnable = false; SaveandcloseButtonEnable = false; HoldButtonVisibility = BarItemVisibility.Never; // ribbon.Hide = true; //ribbon.Visible = false; } } }
private void DoSave(bool downall = false) { if (lookupto.GetColumnValue("COMPANY").ToString() != Utils.Company) { var dr = _dsdownload.NewRow(); dr[0] = _ds.ITEMTRANSFERMAIN[0]["TRANID"].ToString(); dr[1] = _ds.ITEMTRANSFERMAIN[0]["TRANDATE"].ToString(); dr[2] = _ds.ITEMTRANSFERMAIN[0]["FRMNAME"].ToString(); dr[3] = "File not belongs your store"; _dsdownload.Rows.Add(dr); return; } btnbrowse.Enabled = false; btnsave.Enabled = false; var blitemmove = new Blitemmove(); foreach (DataRow d in _ds.ITEMTRANSFERMAIN.Rows) { blitemmove.Tranid = d["TRANID"].ToString(); if (d["TOCOMP"].ToString() != Utils.Company) { var dr = _dsdownload.NewRow(); //dr[0] = _ds.ITEMTRANSFERMAIN[0]["TRANID"].ToString(); //dr[1] = _ds.ITEMTRANSFERMAIN[0]["TRANDATE"].ToString(); //dr[2] = _ds.ITEMTRANSFERMAIN[0]["FRMNAME"].ToString(); dr[0] = d["TRANID"].ToString(); dr[1] = d["TRANDATE"].ToString(); dr[2] = d["FRMNAME"].ToString(); dr[3] = "File not belongs your store"; _dsdownload.Rows.Add(dr); } else { blitemmove.GetItemMoveByTranid(); if (blitemmove.Itemtransferdetail.Rows.Count > 0) { var dr = _dsdownload.NewRow(); dr[0] = d["TRANID"].ToString(); dr[1] = d["TRANDATE"].ToString(); dr[2] = d["FRMNAME"].ToString(); dr[3] = "File already download"; _dsdownload.Rows.Add(dr); } else { var dr = _dsdownload.NewRow(); dr[0] = d["TRANID"].ToString(); dr[1] = d["TRANDATE"].ToString(); dr[2] = d["FRMNAME"].ToString(); var bl = new ItemDownLoadDataManager {whid = lookupto.EditValue.ToString()}; var retval = bl.DoSave(_ds, dr[0].ToString(), downall); if (retval == "1") { new RemoteSync().UpDateRemoteTransferMain(dr[0].ToString()); tranids += dr[0] + ","; // SetUpdateFlagInServer() dr[3] = "Data Download Sucessfully"; if (_negativestockmaster.Rows.Count > 0) { var f = new FrmNegativeStockReplace {GetDsInventory = _negativestockmaster}; f.Show(); } } else { dr[3] = "Error" + retval; btnbrowse.Enabled = true; btnsave.Enabled = true; } _dsdownload.Rows.Add(dr); } } } }