private void Save() { if (ShipmentId == -1) { Sql.ExecuteCmd(SaveProcedure, new object[] { "@ShipmentId", tShipmentId.Text, "@ShipmentNo", tShipmentNo.Text, "@PartnerId", SelectedPartnerId, "@WarehouseId", GlobalUser.CurrentWarehouseId, "@CreateDate", DateTime.Now.ToShortDateString(), "@UpdateDate", DateTime.Now.ToShortDateString() }); ShipmentId = NullCheck.IsNullInt(Sql.GetString($"SELECT dbo.ValidateSaveShipment('{tShipmentNo.Text}')")); tShipmentId.Text = NullCheck.IsNullString(ShipmentId); if (ShipmentId > 0) { LoadData(); } } else { Sql.ExecuteCmd(UpdateProcedure, new object[] { "@ShipmentId", ShipmentId, "@ShipmentNo", tShipmentNo.Text, "@PartnerId", SelectedPartnerId, "@WarehouseId", GlobalUser.CurrentWarehouseId, "@UpdateDate", DateTime.Now.ToShortDateString() }); } LogAction(ShipmentId == -1 ? SaveProcedure : UpdateProcedure); }
public void LoadData() { DataTable dt = Sql.GetTable(SelectProcedure, new object[] { "@WarehouseZoneId", WarehouseZoneId }); if (dt.Rows.Count > 0) { tFZoneCode.Text = NullCheck.IsNullString(dt.Rows[0]["ZoneCode"]); tFZoneName.Text = NullCheck.IsNullString(dt.Rows[0]["ZoneName"]); tWarehouse.Text = NullCheck.IsNullString(dt.Rows[0]["WarehouseName"]); tCreated.Text = NullCheck.IsNullDate(dt.Rows[0]["CreateDate"]).ToShortDateString(); tUpdated.Text = NullCheck.IsNullDate(dt.Rows[0]["UpdateDate"]).ToShortDateString(); FZoneParentId = NullCheck.IsNullInt(dt.Rows[0]["ParentID"]); tSpotHeight.Text = NullCheck.IsNullString(dt.Rows[0]["SpotHeight"]); tSpotLength.Text = NullCheck.IsNullString(dt.Rows[0]["SpotLength"]); tSpotWidth.Text = NullCheck.IsNullString(dt.Rows[0]["SpotWidth"]); tSpotVolume.Text = NullCheck.IsNullString(dt.Rows[0]["SpotVolume"]); } RemainingVolume = NullCheck.IsNullDecimal(Sql.GetString($"SELECT dbo.RemainingZoneVolume('{WarehouseZoneId}')")); if (NullCheck.IsNullDecimal(dt.Rows[0]["SpotVolume"]) != RemainingVolume) { tSpotHeight.Enabled = false; tSpotLength.Enabled = false; tSpotVolume.Enabled = false; tSpotWidth.Enabled = false; } }
private void toolStripButton3_Click(object sender, EventArgs e) { if (!CustomDelete) { if (string.IsNullOrEmpty(DeleteSql)) { MessageBox.Show("Nenurodyta duomenų trynimo procedūra", "Įspėjimas", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (dataGridView1.SelectedCells.Count <= 0) { MessageBox.Show("Nepasirinkta duomenų eilutė", "Įspėjimas", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (string.IsNullOrEmpty(FormMainId)) { MessageBox.Show("Nenurodytas formos ID", "Įspėjimas", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } int id = NullCheck.IsNullInt(NullCheck.IsNullString(dataGridView1.SelectedRows[0].Cells[FormMainId].Value)); if (id > 0) { Sql.ExecuteCmd(DeleteSql, new object[] { $"@{FormMainId}", id }); } RefreshGrid(); } }
private void DataGridView2_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { DataGridViewRow row = dataGridView2.Rows[e.RowIndex]; if ((row.Cells["Name"].Selected || row.Cells["Code"].Selected)) { int SelectedItemId = ItemMapper.SelectItemId(); if (SelectedItemId > 0) { DataTable dt = Sql.GetTable("SelectItemList", new object[] { "@ItemId", SelectedItemId }); if (dt != null && dt.Rows.Count > 0) { _handle = false; row.Cells["Name"].Value = NullCheck.IsNullString(dt.Rows[0]["Name"]); row.Cells["Code"].Value = NullCheck.IsNullString(dt.Rows[0]["Code"]); row.Cells["Barcode"].Value = NullCheck.IsNullString(dt.Rows[0]["Barcode"]); row.Cells["Description"].Value = NullCheck.IsNullString(dt.Rows[0]["Description"]); row.Cells["ItemTypeName"].Value = NullCheck.IsNullString(dt.Rows[0]["Name"]); row.Cells["NetWeight"].Value = NullCheck.IsNullString(dt.Rows[0]["NetWeight"]); row.Cells["BrutoWeight"].Value = NullCheck.IsNullString(dt.Rows[0]["BrutoWeight"]); row.Cells["UnitName"].Value = NullCheck.IsNullString(dt.Rows[0]["UnitName"]); row.Cells["Volume"].Value = NullCheck.IsNullString(dt.Rows[0]["Volume"]); row.Cells["Width"].Value = NullCheck.IsNullString(dt.Rows[0]["Width"]); row.Cells["Height"].Value = NullCheck.IsNullString(dt.Rows[0]["Height"]); row.Cells["ItemId"].Value = SelectedItemId; _handle = true; row.Cells["Name"].Selected = false; row.Cells["Code"].Selected = false; } } } } }
private void RecalculateSpotVolume() { if (string.IsNullOrEmpty(tSpotLength.Text) || string.IsNullOrEmpty(tSpotWidth.Text) || string.IsNullOrEmpty(tSpotHeight.Text)) { return; } tSpotVolume.Text = NullCheck.IsNullString(NullCheck.IsNullDecimal(tSpotLength.Text) * NullCheck.IsNullDecimal(tSpotWidth.Text) * NullCheck.IsNullDecimal(tSpotHeight.Text)); }
public static void MovePallet() { string PalletId = NullCheck.IsNullString(Sql.GetString($"SELECT dbo.GetPalletId('{Cache.ReturnValueByKey("@Barcode")}')")); Sql.ExecuteCmd("MovePallet", new object[] { "@ToZoneId", Cache.ReturnValueByKey("@Location"), "@Whid", GlobalUser.CurrentWarehouseId, "@PalletId", PalletId }); }
public static void ParseDataTable(DataTable data) { Username = NullCheck.IsNullString(data.Rows[0][nameof(Username)]); Name = NullCheck.IsNullString(data.Rows[0][nameof(Name)]); Surname = NullCheck.IsNullString(data.Rows[0][nameof(Surname)]); UserLevel = NullCheck.IsNullInt(data.Rows[0][nameof(UserLevel)]); UserId = NullCheck.IsNullInt(data.Rows[0][nameof(UserId)]); SuperUser = NullCheck.IsNullBoolean(data.Rows[0][nameof(SuperUser)]); LogLogin(); }
public void LoadData() { DataTable dt = Sql.GetTable(SelectProcedure, new object[] { "@RcvOrdId", DocId }); if (dt != null && dt.Rows.Count > 0) { tDocNo.Text = NullCheck.IsNullString(dt.Rows[0]["DocumentNo"]); tCreateDate.Text = NullCheck.IsNullDate(dt.Rows[0]["Created"]).ToShortDateString(); tUpdated.Text = NullCheck.IsNullDate(dt.Rows[0]["Updated"]).ToShortDateString(); LoadDView(); } }
public void LoadData() { DataTable dt = Sql.GetTable(SelectProcedure, new object[] { "@PalletId", WarehouseId }); if (dt.Rows.Count > 0) { tNumber.Text = NullCheck.IsNullString(dt.Rows[0]["WarehouseId"]); tHeight.Text = NullCheck.IsNullString(dt.Rows[0]["PalletHeight"]); tWidth.Text = NullCheck.IsNullDate(dt.Rows[0]["PalletWidth"]).ToShortDateString(); tLength.Text = NullCheck.IsNullDate(dt.Rows[0]["PalletLength"]).ToShortDateString(); tVolume.Text = NullCheck.IsNullDate(dt.Rows[0]["PalletVolume"]).ToShortDateString(); } }
public void LoadData() { DataTable dt = Sql.GetTable(SelectProcedure, new object[] { "@WarehouseId", WarehouseId }); if (dt.Rows.Count > 0) { tCode.Text = NullCheck.IsNullString(dt.Rows[0]["WarehouseCode"]); tName.Text = NullCheck.IsNullString(dt.Rows[0]["WarehouseName"]); cWarehouseLocId.SelectedValue = NullCheck.IsNullString(dt.Rows[0]["LocationId"]); tCreateDate.Text = NullCheck.IsNullDate(dt.Rows[0]["CreateDate"]).ToShortDateString(); tUpdated.Text = NullCheck.IsNullDate(dt.Rows[0]["UpdateDate"]).ToShortDateString(); } }
private void SetScanWO() { ClearInput(); EnableInput(true); ClearLabels(); DisableInfo(); EnableRows(new string[] { "4", "5", "8" }); SetRow4("Nuskenuokite prekę", ContentAlignment.MiddleCenter); SetRow5($"Prekė: [{NullCheck.IsNullString(ItemList.Rows[0]["Name"])}] Kodas: [{NullCheck.IsNullString(ItemList.Rows[0]["Code"])}]", ContentAlignment.MiddleCenter, Color.Chocolate); EnableRows(new string[] { "t1" }); SetTextBoxLabel1("Barkodas:"); EnableInput(input1: true); FocusInput1(); }
private void SetScanItem() { ClearInput(); ClearLabels(); DisableInfo(); EnableRows(new string[] { "5", "8" }); SetRow5("Įrašykite gautą kiekį", ContentAlignment.MiddleCenter); SetRow8($"Prekė: [{NullCheck.IsNullString(ItemList.Rows[0]["Name"])}] Barkodas: [{NullCheck.IsNullString(ItemList.Rows[0]["Barcode"])}]", ContentAlignment.MiddleCenter, Color.Chocolate); EnableRows(new string[] { "t1" }); SetTextBoxLabel1("Kiekis:"); Cache.AddParameter("@ScanBarcode", NullCheck.IsNullString(ItemList.Rows[0]["Barcode"])); EnableInput(input1: true); FocusInput1(); }
public void LoadData() { DataTable dt = Sql.GetTable(SelectProcedure, new object[] { "@PartnerId", PartnerId }); if (dt.Rows.Count > 0) { tPartnerCode.Text = NullCheck.IsNullString(dt.Rows[0]["PartnerCode"]); tPartnerName.Text = NullCheck.IsNullString(dt.Rows[0]["Partnername"]); cbCustomer.Checked = NullCheck.IsNullBoolean(dt.Rows[0]["IsCustomer"]); cbSupply.Checked = NullCheck.IsNullBoolean(dt.Rows[0]["IsSupplier"]); tCreated.Text = NullCheck.IsNullDate(dt.Rows[0]["Created"]).ToShortDateString(); tUpdated.Text = NullCheck.IsNullDate(dt.Rows[0]["Updated"]).ToShortDateString(); } }
private bool ValidInput() { string errorMsg = string.Empty; if (string.IsNullOrEmpty(tDocNo.Text)) { tDocNo.Text = NullCheck.IsNullString(Sql.GetTable("GenerateDocNoRcvOrd").Rows[0][0]); } if (!string.IsNullOrEmpty(errorMsg)) { MessageBox.Show("Negalima išsaugoti dokumento:\n" + errorMsg, "Klaida", MessageBoxButtons.OK); return(false); } return(true); }
public static void SaveItemsToZoneAndPallet(DataTable dt) { string PalletId = NullCheck.IsNullString(Sql.GetString($"SELECT dbo.GetPalletId('{Cache.ReturnValueByKey("@Barcode")}')")); DataTable Insert = ProcessDataTableQuantityById(dt); foreach (DataRow row in Insert.Rows) { Sql.ExecuteCmd("SaveStoredItem", new object[] { "@PalletId", PalletId, "@ItemId", row["ItemId"], "@Created", DateTime.Now, "@Updated", DateTime.Now, "@Quantity", row["Quantity"] }); } }
public void LoadData() { DataTable dt = Sql.GetTable(SelectProcedure, new object[] { "@ShipmentId", ShipmentId }); if (dt != null && dt.Rows.Count > 0) { tShipmentId.Text = NullCheck.IsNullString(ShipmentId); SelectedPartnerId = NullCheck.IsNullInt(dt.Rows[0]["PartnerId"]); tPartner.Text = NullCheck.IsNullString(dt.Rows[0]["PartnerName"]); tWarehouse.Text = NullCheck.IsNullString(dt.Rows[0]["WarehouseName"]); tShipmentNo.Text = NullCheck.IsNullString(dt.Rows[0]["ShipmentNo"]); tCreateDate.Text = NullCheck.IsNullDate(dt.Rows[0]["CreateDate"]).ToShortDateString(); tUpdated.Text = NullCheck.IsNullDate(dt.Rows[0]["UpdateDate"]).ToShortDateString(); LoadDView(); } }
public void LoadData() { DataTable dt = Sql.GetTable(SelectProcedure, new object[] { "@LocationID", LocationId }); if (dt.Rows.Count > 0) { tLocationCode.Text = NullCheck.IsNullString(dt.Rows[0]["LocationCode"]); tCountry.Text = NullCheck.IsNullString(dt.Rows[0]["Country"]); tCity.Text = NullCheck.IsNullString(dt.Rows[0]["City"]); tStreetName.Text = NullCheck.IsNullString(dt.Rows[0]["StreetName"]); tBuildingNo.Text = NullCheck.IsNullString(dt.Rows[0]["BuildingNumber"]); tFlatNo.Text = NullCheck.IsNullString(dt.Rows[0]["FlatNumber"]); tCreated.Text = NullCheck.IsNullDate(dt.Rows[0]["CreateDate"]).ToShortDateString(); tUpdated.Text = NullCheck.IsNullDate(dt.Rows[0]["UpdateDate"]).ToShortDateString(); } }
public void LoadData() { DataTable dt = Sql.GetTable(SelectProcedure, new object[] { "@OutOrderId", DocId }); if (dt.Rows.Count > 0) { tDocNo.Text = NullCheck.IsNullString(dt.Rows[0]["DocumentNo"]); tCustomer.Text = NullCheck.IsNullString(dt.Rows[0]["PartnerName"]); dtPlannedShipment.Value = NullCheck.IsNullDate(dt.Rows[0]["ShippingPlanned"]); tState.Text = NullCheck.IsNullString(dt.Rows[0]["OOStateName"]); tCreateDate.Text = NullCheck.IsNullDate(dt.Rows[0]["Created"]).ToShortDateString(); tUpdated.Text = NullCheck.IsNullDate(dt.Rows[0]["Updated"]).ToShortDateString(); SelectedPartnerId = NullCheck.IsNullInt(dt.Rows[0]["PartnerId"]); StateId = NullCheck.IsNullInt(dt.Rows[0]["OOStateId"]); } }
private void ProcessWOScan() { if (string.IsNullOrEmpty(tBoxInput1.Text)) { EnableRows(9); SetRow9("Negalimas barkodas", ContentAlignment.MiddleCenter, Color.Red); return; } else if (NullCheck.IsNullString(ItemList.Rows[0]["Barcode"]) != tBoxInput1.Text) { EnableRows(9); SetRow9("Netinkamas barkodas", ContentAlignment.MiddleCenter, Color.Red); return; } DisableRows(9); ProcessPickAmount(); }
private void ProcessCUScan() { if (string.IsNullOrEmpty(tBoxInput1.Text)) { EnableRows(9); SetRow9("Negalimas barkodas", ContentAlignment.MiddleCenter, Color.Red); return; } else if (tBoxInput1.Text != NullCheck.IsNullString(ItemList.Rows[0]["Barcode"])) { EnableRows(9); SetRow9("Blogas barkodas", ContentAlignment.MiddleCenter, Color.Red); return; } DisableRows(9); LoadUnloadBarcode(); }
private void LoadUnloadBarcode() { string ScannedBarcode = NullCheck.IsNullString(tBoxInput1.Text); DataRow row = ItemList.AsEnumerable().Where(x => x.Field <string>("Barcode") == ScannedBarcode).FirstOrDefault(); ShippingActions.LoadCU(NullCheck.IsNullInt(row["StoredPalletId"])); ItemList.Rows.Remove(row); ClearInput(); if (ItemList.Rows.Count > 0) { ProcessCULoading(); } else { ProcessLoading(); } }
public void LoadData() { DataTable dt = Sql.GetTable(SelectProcedure, new object[] { "@RcvDocId", DocId }); if (dt.Rows.Count > 0) { tDocNo.Text = NullCheck.IsNullString(dt.Rows[0]["DocCode"]); tSupplier.Text = NullCheck.IsNullString(dt.Rows[0]["PartnerName"]); dtArrivalPlanned.Value = NullCheck.IsNullDate(dt.Rows[0]["ArrivalPlaned"]); tTruckNo.Text = NullCheck.IsNullString(dt.Rows[0]["TruckNo"]); tTrailerNo.Text = NullCheck.IsNullString(dt.Rows[0]["TrailerNo"]); tDriver.Text = NullCheck.IsNullString(dt.Rows[0]["Driver"]); tState.Text = NullCheck.IsNullString(dt.Rows[0]["IOStateName"]); tCreateDate.Text = NullCheck.IsNullDate(dt.Rows[0]["CreateDate"]).ToShortDateString(); tUpdated.Text = NullCheck.IsNullDate(dt.Rows[0]["UpdateDate"]).ToShortDateString(); SelectedPartnerId = NullCheck.IsNullInt(dt.Rows[0]["SupplierId"]); StateId = NullCheck.IsNullInt(dt.Rows[0]["StateId"]); } }
private void LoadTree() { DataTable dt = Sql.GetTable(SelectProcedure, new object[] { "@WarehouseId", GlobalUser.CurrentWarehouseId }); if (dt != null) { DataRow[] ParentNodeRows = dt.AsEnumerable().Where(x => null == x.Field <int?>("ParentId")).ToArray(); foreach (DataRow row in ParentNodeRows) { if (!treeView1.Nodes.ContainsKey(NullCheck.IsNullString(row["WarehouseZoneId"]))) { treeView1.Nodes.Add(NullCheck.IsNullString(row["WarehouseZoneId"]), NullCheck.IsNullString(row["ZoneName"])); } else { TreeNode node = treeView1.Nodes.Find(NullCheck.IsNullString(row["WarehouseZoneId"]), false).FirstOrDefault(); node.Text = NullCheck.IsNullString(row["ZoneName"]); } } DataRow[] ChildNodeRows = dt.AsEnumerable().Where(x => null != x.Field <int?>("ParentId")).ToArray(); foreach (DataRow row in ChildNodeRows) { TreeNode node = treeView1.Nodes.Find(NullCheck.IsNullString(row["ParentId"]), false).FirstOrDefault(); if (node != null) { if (!node.Nodes.ContainsKey(NullCheck.IsNullString(row["WarehouseZoneId"]))) { node.Nodes.Add(NullCheck.IsNullString(row["WarehouseZoneId"]), NullCheck.IsNullString(row["ZoneName"])); } else { TreeNode node_ = node.Nodes.Find(NullCheck.IsNullString(row["WarehouseZoneId"]), false).FirstOrDefault(); node_.Text = NullCheck.IsNullString(row["ZoneName"]); } } } } treeView1.AfterSelect += TreeView1_AfterSelect; }
private void TreeView1_AfterSelect(object sender, TreeViewEventArgs e) { string NodeKey = e.Node.Name; DataTable dt = Sql.GetTable("GetWarehouseZoneById", new object[] { "@WarehouseZoneId", NodeKey }); if (dt != null) { tFZoneCode.Text = NullCheck.IsNullString(dt.Rows[0]["ZoneCode"]); tFZoneName.Text = NullCheck.IsNullString(dt.Rows[0]["ZoneName"]); tParentNode.Text = NullCheck.IsNullString(dt.Rows[0]["ParentName"]); tWarehouse.Text = NullCheck.IsNullString(dt.Rows[0]["WarehouseName"]); tCreated.Text = NullCheck.IsNullString(dt.Rows[0]["CreateDate"]); tUpdated.Text = NullCheck.IsNullString(dt.Rows[0]["UpdateDate"]); tSpotHeight.Text = NullCheck.IsNullString(dt.Rows[0]["SpotHeight"]); tSpotWidth.Text = NullCheck.IsNullString(dt.Rows[0]["SpotWidth"]); tZoneLength.Text = NullCheck.IsNullString(dt.Rows[0]["SpotLength"]); tZoneVolume.Text = NullCheck.IsNullString(dt.Rows[0]["SpotVolume"]); tZoneRemainingVolume.Text = NullCheck.IsNullString(dt.Rows[0]["SpotRemainingVolume"]); } }
private bool ValidInput() { string errorMsg = string.Empty; if (string.IsNullOrEmpty(tDocNo.Text)) { tDocNo.Text = NullCheck.IsNullString(Sql.GetTable("GenerateDocNoOutOrder").Rows[0][0]); } if (string.IsNullOrEmpty(tCustomer.Text)) { tCustomer.Invalidate(); errorMsg += "Negalimas partneris\n"; } if (!string.IsNullOrEmpty(errorMsg)) { MessageBox.Show("Negalima išsaugoti išsiuntimo užsakymo:\n" + errorMsg, "Klaida", MessageBoxButtons.OK); return(false); } return(true); }
public void LoadData() { DataTable dt = Sql.GetTable(SelectProcedure, new object[] { "@ItemId", ItemId }); if (dt.Rows.Count > 0) { tItemCode.Text = NullCheck.IsNullString(dt.Rows[0]["Code"]); tItemName.Text = NullCheck.IsNullString(dt.Rows[0]["Name"]); tItemDescription.Text = NullCheck.IsNullString(dt.Rows[0]["Description"]); cItemType.SelectedValue = NullCheck.IsNullString(dt.Rows[0]["TypeId"]); tNetWeight.Text = NullCheck.IsNullString(dt.Rows[0]["NetWeight"]); tBrutoWeight.Text = NullCheck.IsNullString(dt.Rows[0]["BrutoWeight"]); tVolume.Text = NullCheck.IsNullString(dt.Rows[0]["Volume"]); cMU.SelectedValue = NullCheck.IsNullString(dt.Rows[0]["MeasureUnitId"]); tCreateDate.Text = NullCheck.IsNullDate(dt.Rows[0]["CreateDate"]).ToShortDateString(); tUpdated.Text = NullCheck.IsNullDate(dt.Rows[0]["UpdateDate"]).ToShortDateString(); tWarehouseId.Text = NullCheck.IsNullString(dt.Rows[0]["WarehouseCode"]); tBarcode.Text = NullCheck.IsNullString(dt.Rows[0]["Barcode"]); tWidth.Text = NullCheck.IsNullString(dt.Rows[0]["Width"]); tHeight.Text = NullCheck.IsNullString(dt.Rows[0]["Height"]); } }