private bool ControlsValidated() { //validate combo and grids string errorMessage = ""; if (drpShed.SelectedIndex <= 0) { errorMessage += "Please select Shed! "; } else if (drpLIC.SelectedIndex <= 0) { errorMessage += "Please select Lead Inventory Controller! "; } else if (drpInventoryReason.SelectedIndex <= 0) { errorMessage += "Please select Inventory Reason"; } else if (gvInventoryInspectors.Rows.Count <= 0) { errorMessage += "Please add atleast one inspector!"; } else if (gvInventoryDetail.Rows.Count <= 0) { errorMessage += "One or more inventory detail required!"; } if (errorMessage != string.Empty) { Messages1.SetMessage(errorMessage, Messages.MessageType.Error); return(false); } return(true); }
protected void btnTransfer_Click(object sender, EventArgs e) { if (InitializeInventoryTransfer()) { try { InventoryTransfer.InsertInventoryTransfer(); Messages1.SetMessage("Record added successfully.", WarehouseApplication.Messages.MessageType.Success); if (InventoryTransfer.ID != null) { Session["StackId"] = InventoryTransfer.ID; ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowReport", "<script type=\"text/javascript\">" + string.Format("javascript:window.open(\"ReportInventoryTransfer.aspx?id={0}\", \"_blank\",\"height=400px,width=600px,top=0,left=0,resizable=yes,scrollbars=yes\");", Guid.NewGuid()) + "</script>", false); } } catch (Exception ex) { Messages1.SetMessage(ex.Message, WarehouseApplication.Messages.MessageType.Error); } } }
private bool ControlsValidated() { //validate combo and grids string IsCoff = InventoryControlModel.GetCommodityByGrade(new Guid(Session["CommGraID"].ToString()))[0].ToString(); string errorMessage = ""; if (drpShed.SelectedIndex <= 0) { errorMessage += "Please select Shed! "; } else if (drpLIC.SelectedIndex <= 0) { errorMessage += "Please select Lead Inventory Controller! "; } else if (drpInventoryReason.SelectedIndex <= 0) { errorMessage += "Please select Inventory Reason"; } else if (gvInventoryInspectors.Rows.Count <= 0) { errorMessage += "Please add atleast one inspector!"; } else if (gvInventoryDetail.Rows.Count <= 0 && IsCoff != "71604275-df23-4449-9dae-36501b14cc3b") { errorMessage += "One or more inventory detail required!"; } if (errorMessage != string.Empty) { Messages1.SetMessage(errorMessage, Messages.MessageType.Error); return(false); } return(true); }
protected void grvInvTransferApproval_SelectedIndexChanged(object sender, EventArgs e) { Guid ID = new Guid(((Label)grvInvTransferApproval.SelectedRow.FindControl("lblID")).Text); Guid StackID = new Guid(((Label)grvInvTransferApproval.SelectedRow.FindControl("lblStackID")).Text); Guid StackID2 = new Guid(((Label)grvInvTransferApproval.SelectedRow.FindControl("lblStackID2")).Text); Guid LIC2 = new Guid(((Label)grvInvTransferApproval.SelectedRow.FindControl("lblLICID2")).Text); int PhysicalCount = int.Parse(((Label)grvInvTransferApproval.SelectedRow.FindControl("lblPhysicalCount")).Text); int PhysicalCount2 = int.Parse(((Label)grvInvTransferApproval.SelectedRow.FindControl("lblPhysicalCount2")).Text); float PhysicalWeight = float.Parse(((Label)grvInvTransferApproval.SelectedRow.FindControl("lblPhysicalWeight")).Text); float PhysicalWeight2 = float.Parse(((Label)grvInvTransferApproval.SelectedRow.FindControl("lblPhysicalWeight2")).Text); Guid ApprovedByID = UserBLL.CurrentUser.UserId; DateTime DateApproved = DateTime.Now; try { InventoryTransferModel.ApproveInventorysTransfer(ID, ApprovedByID, DateApproved, StackID, StackID2, LIC2, (PhysicalCount + PhysicalCount2), (PhysicalWeight + PhysicalWeight2)); Messages1.SetMessage("Record approved successfully.", WarehouseApplication.Messages.MessageType.Success); BindApprovalGridview(); } catch (Exception ex) { Messages1.SetMessage(ex.Message, WarehouseApplication.Messages.MessageType.Error); } }
private void OnMessageRaised(object sender, MessageEventArgs e) { Messages.Document.Blocks.Add(new Paragraph(new Run(e.Message))); Messages.ScrollToEnd(); Messages1.Document.Blocks.Add(new Paragraph(new Run(e.Message))); Messages1.ScrollToEnd(); }
protected void btnSave_Click(object sender, EventArgs e) { Messages1.ClearMessage(); InitializeStoreIssueVoucher(); try { if (isEdit == null) { fIssueVoucher.InsertFixedAssetIssueVoucher(); Messages1.SetMessage("Record added successfully.", Messages.MessageType.Success); } else { fIssueVoucher.ID = FAIVID; fIssueVoucher.UpdateFixedAssetIssueVoucher(); Messages1.SetMessage("Record updated successfully.", Messages.MessageType.Success); GetFixedAssetIssueVoucherList(); } } catch (Exception ex) { Messages1.SetMessage(ex.Message, Messages.MessageType.Error); } }
protected void grvStoreRequest_SelectedIndexChanged(object sender, EventArgs e) { ClearControls(); Messages1.ClearMessage(); try { if (isEdit != null) { ViewState.Add("isEdit", true); btnSave.Enabled = true; btnSave.Text = "Update"; ViewState.Add("SRID", new Guid(grvStoreRequest.SelectedDataKey[0].ToString())); DataRow r = sRequest.GetStoreRequest(SRID); BindStoreRequestInfo(r); if (!(r["SIVNo"].ToString().Equals("") && r["PRNo"].ToString().Equals(""))) // disable Editing { btnSave.Enabled = false; } } else { sRequest.CancelStoreRequest(new Guid(grvStoreRequest.SelectedDataKey[0].ToString()), new Guid(UserPrincipal.Current.Guid.ToString()), DateTime.Now); Messages1.SetMessage("Record canceled successfully.", Messages.MessageType.Success); GetStoreRequestList(); } } catch (Exception ex) { Messages1.SetMessage(ex.Message, Messages.MessageType.Error); } }
private void SendMessage1(IMessage message) { if (message.Key.Equals(string.Empty) == false && props.Contains(message.Key.ToString())) { message = new Message(message.From, node2.Key, message.Key, message.Content); if (message.Key.Equals(nameof(node1.X))) { RaisePropertyChanged(nameof(this.X1)); } if (message.Key.Equals(nameof(node1.Y))) { RaisePropertyChanged(nameof(this.Y1)); message = Modify(message, node1.Size); } MovePoint1To2(); Task.Delay(Delay).ContinueWith(a => { Messages1.Add(message); node2.NextMessage(message); }, TaskScheduler.FromCurrentSynchronizationContext()); } }
bool IsValidStack() { int balance; float weight; DateTime startDate; if (txtBeginingBalance.Text == "" || txtBeginingWeight.Text == "" || txtDateStarted.Text == "" || ddLIC.SelectedValue == "" || ddlPhysicalAddress.SelectedValue == "" || ddlProductionYear.SelectedValue == "" || ddlShedID.SelectedValue == "" || ddlBagType.SelectedValue == "") { Messages1.SetMessage("Please enter all values.", WarehouseApplication.Messages.MessageType.Success); return(false); } else if (!(int.TryParse(txtBeginingBalance.Text, out balance))) { Messages1.SetMessage("Please enter valid balance.", WarehouseApplication.Messages.MessageType.Success); return(false); } else if (!(float.TryParse(txtBeginingWeight.Text, out weight))) { Messages1.SetMessage("Please enter valid weight.", WarehouseApplication.Messages.MessageType.Success); return(false); } else if (!(DateTime.TryParse(txtDateStarted.Text, out startDate))) { Messages1.SetMessage("Please enter valid Date.", WarehouseApplication.Messages.MessageType.Success); return(false); } else { return(true); } }
bool isValidTransferDetail(string phyCount, string phyWeight) { int count; float weight; if (phyCount == "" || phyWeight == "") { Messages1.SetMessage("Please physical count and weight. ", WarehouseApplication.Messages.MessageType.Warning); countError++; return(false); } else if (!(int.TryParse(phyCount, out count))) { Messages1.SetMessage("Please enter valid number. ", WarehouseApplication.Messages.MessageType.Warning); countError++; return(false); } else if (!(float.TryParse(phyWeight, out weight))) { Messages1.SetMessage("Please enter valid weight.", WarehouseApplication.Messages.MessageType.Warning); countError++; return(false); } else { return(true); } }
protected void btnAdd_Click(object sender, EventArgs e) { string SamplersAttedanceXML = "<SamplersAttendance>"; foreach (GridViewRow grvRow in grvSamplersAttenendance.Rows) { SamplersAttedanceXML += "<SamplerAttendanceItem>" + "<OperatorID>" + ((Label)grvRow.FindControl("lblID")).Text + "</OperatorID>" + "<Status>" + ((CheckBox)grvRow.FindControl("chbIsAvailable")).Checked + "</Status>" + "<Reason>" + "Daily Attendance" + "</Reason>" + "<CreatedBy>" + UserBLL.CurrentUser.UserId + "</CreatedBy>" + "<CreatedTimestamp>" + DateTime.Now + "</CreatedTimestamp>" + "<OperationDate>" + DateTime.Now + "</OperationDate>" + "<WarehouseID>" + Session["CurrentWarehouse"].ToString() + "</WarehouseID>" + "</SamplerAttendanceItem>"; } SamplersAttedanceXML += "</SamplersAttendance>"; try { SamplerAttendaceModel.AddSamplersAttendance(SamplersAttedanceXML); Messages1.SetMessage("Record added successfully.", WarehouseApplication.Messages.MessageType.Success); BindSamlerGridviewForEdit(); btnAdd.Visible = false; } catch (Exception ex) { Messages1.SetMessage(ex.Message, WarehouseApplication.Messages.MessageType.Error); } }
protected void grvSamplersAttenendance_SelectedIndexChanged(object sender, EventArgs e) { Guid ID = new Guid(((Label)grvSamplersAttenendance.SelectedRow.FindControl("lblID")).Text); bool Status = ((CheckBox)grvSamplersAttenendance.SelectedRow.FindControl("chbIsAvailable")).Checked; string reason = ((TextBox)grvSamplersAttenendance.SelectedRow.FindControl("txtReason")).Text; Guid LastModifiedBy = UserBLL.CurrentUser.UserId; DateTime LastModifiedDate = DateTime.Now; if (reason == "") { Messages1.SetMessage("Please enter reason", WarehouseApplication.Messages.MessageType.Warning); } else { try { SamplerAttendaceModel.UpdateSamplersAttendance(ID, Status, LastModifiedBy, LastModifiedDate, reason); Messages1.SetMessage("Record updated successflly. ", WarehouseApplication.Messages.MessageType.Success); BindSamlerGridviewForEdit(); } catch (Exception ex) { Messages1.SetMessage(ex.Message, WarehouseApplication.Messages.MessageType.Error); } } }
protected void grvTM_SelectedIndexChanged(object sender, EventArgs e) { ClearControls(); Messages1.ClearMessage(); ViewState.Add("TMID", new Guid(grvTM.SelectedDataKey[0].ToString())); try { if (isEdit != null) { ViewState.Add("isEdit", true); btnSave.Enabled = true; btnSave.Text = "Update"; DataRow r = transferedMaterial.GetTransferedMaterial(TMID); BindTransferedMaterialInfo(r); } else { transferedMaterial.CancelTransferedMaterial(TMID, new Guid(), DateTime.Now);//new Guid(UserPrincipal.Current.Guid.ToString()), DateTime.Now); Messages1.SetMessage("Record canceled successfully.", Messages.MessageType.Success); GetTransferedMaterialList(); } } catch (Exception ex) { Messages1.SetMessage(ex.Message, Messages.MessageType.Error); } }
protected void btnSave_Click(object sender, EventArgs e) { InitializeTransferedMaterial(); { try { if (isEdit == null) { transferedMaterial.InsertTransferedMaterial(); Messages1.SetMessage("Record added successfully.", Messages.MessageType.Success); } else { transferedMaterial.ID = TMID; transferedMaterial.UpdateTransferedMaterial(); Messages1.SetMessage("Record updated successfully.", Messages.MessageType.Success); GetTransferedMaterialList(); } } catch (Exception ex) { Messages1.SetMessage(ex.Message, Messages.MessageType.Error); } } }
protected void btnSave_Click(object sender, EventArgs e) { Messages1.ClearMessage(); InitializeReturnedMaterial(); try { if (isEdit == null) { returnedMaterial.InsertReturnedMaterial(); Messages1.SetMessage("Record added successfully.", Messages.MessageType.Success); } else { returnedMaterial.ID = RMID; returnedMaterial.UpdateReturnedMaterial(); Messages1.SetMessage("Record updated successfully.", Messages.MessageType.Success); GetReturnedMaterialList(); } } catch (Exception ex) { Messages1.SetMessage(ex.Message, Messages.MessageType.Error); } }
protected void btnAddInventroyinspector_Click(object sender, EventArgs e) { Messages1.ClearMessage(); if (drpInventoryInspector.SelectedIndex <= 0) { Messages1.SetMessage("Inventory Adjustment was succesfully saved!", Messages.MessageType.Success); upMessage.Update(); return; } InventoryInspector invIns = new InventoryInspector(); invIns.InspectorID = new Guid(drpInventoryInspector.SelectedValue); Guid insID = invIns.InspectorID; invIns.InspectorName = drpInventoryInspector.SelectedItem.Text; List <InventoryInspector> invInsectors = inventoryInspectors; if (invInsectors.Exists(iins => iins.InspectorID.Equals(insID))) { Messages1.SetMessage("The inspector is already added to the list!", Messages.MessageType.Warning); upMessage.Update(); return; } invInsectors.Add(invIns); ViewState.Add("InventoryInspectors", invInsectors); gvInventoryInspectors.DataSource = inventoryInspectors; gvInventoryInspectors.DataBind(); drpInventoryInspector.ClearSelection(); upMessage.Update(); }
public void Post(int id, int Conversation_ID, int DeptID, int AccountID, DateTime DateMade, byte[] Message, string Type, string FileLocation, string keyWords, int Upvotes, int Views, int ReadAccess, int WriteAccess) { Messages1 m = new Messages1(); m.ID = id; m.CONVERSATION_ID = Conversation_ID; m.DEPT_ID = DeptID; m.ACCOUNT_ID = AccountID; m.DATE_MADE = DateMade; m.MESSAGE = Message; m.TYPE = Type; m.FILE_LOCATION = FileLocation; m.KEYWORDS = keyWords; m.UPVOTES = Upvotes; m.VIEWS = Views; m.READ_ACCESS = ReadAccess; m.WRITE_ACCESS = WriteAccess; MSG.CreateMessage(m); }
private void FillShedByWarehouse(Guid warehouseID, string shedId, string LICID, string CGID, string PY) { drpShed.DataSource = null; drpShed.Items.Clear(); drpShed.Items.Add(new ListItem("- - Please Select Shed - -", "")); DataRow[] drs = null; if (shedId != string.Empty) { DataTable dt = InventoryControlModel.GetShedByWarehouse(warehouseID); drs = dt.Select("ShedID = '" + shedId + "'"); if (drs.Count() <= 0) { Messages1.SetMessage("Selected Shed for the PSA does not exist!", Messages.MessageType.Error); return; } object[] obj = drs[0].ItemArray; dt.Clear(); dt.Rows.Add(obj); drpShed.DataSource = dt; } else { drpShed.DataSource = InventoryControlModel.GetShedByWarehouse(warehouseID); } drpShed.DataValueField = "ShedID"; drpShed.DataTextField = "ShedNo"; drpShed.DataBind(); if (shedId != string.Empty && drpShed.Items.Count > 1) { drpShed.SelectedIndex = 1; FillLIC(new Guid(drpShed.SelectedValue), LICID, CGID, PY); drpShed.Enabled = false; } }
private bool FillInfo(string GradingCode) { List <GradingModel> listCode = GradingModel.GetCodeInformationByCode(GradingCode); if (listCode[0].GradingResultStatusID > 0) { PopulateGradeResult(GradingCode); return(false); } ViewState["GradingResultID"] = listCode[0].ID; lblGradingCodeValue.Text = listCode[0].GradingCode; lblCodeGeneratedDateValue.Text = listCode[0].DateTimeCoded.ToShortDateString(); lblCodeGeneratedTimeValue.Text = listCode[0].DateTimeCoded.ToShortTimeString(); lblGraderCupperValue.Text = BLL.UserBLL.GetName(listCode[0].UserId); txtCommodity.Text = listCode[0].CommodityName; if (listCode[0].CommodityID == null) { Messages1.SetMessage("Please specify the commodity in Arrival form to continue!"); return(true); } ViewState.Add(GradingConstants.CommodityId.ToString(), listCode[0].CommodityID.ToString()); ViewState.Add(GradingConstants.IsNonCoffee.ToString(), !ConfigurationManager.AppSettings["CoffeeId"].ToUpper().Trim().Equals(listCode[0].CommodityID.ToString().ToUpper().Trim())); ViewState.Add(GradingConstants.WeradaId.ToString(), listCode[0].WoredaID.ToString()); ViewState.Add(GradingConstants.GradingID.ToString(), GradingCodeID); ViewState.Add(GradingConstants.CommodityTypeID.ToString(), listCode[0].VoucherCommodityTypeID); txtDateRecived.Text = DateTime.Now.ToShortDateString(); txtTimeRecived.Text = DateTime.Now.ToShortTimeString(); return(true); }
bool isValidDateTime(string dateEntered, string timeEntered, DateTime PreviousDate) { DateTime t; if (dateEntered == "" || timeEntered == "") { Messages1.SetMessage("Please enter date and time ", WarehouseApplication.Messages.MessageType.Warning); return(false); } else if (!(DateTime.TryParse((dateEntered + " " + timeEntered), out t))) { Messages1.SetMessage("Please enter valid date and time ", WarehouseApplication.Messages.MessageType.Warning); return(false); } else if ((DateTime.Parse((dateEntered + " " + timeEntered)) < PreviousDate)) { Messages1.SetMessage("Please enter valid date and time ", WarehouseApplication.Messages.MessageType.Warning); return(false); } else if (DateTime.Parse(dateEntered) > (DateTime.Now))//+ " " + timeEntered)) > DateTime.Now)) { Messages1.SetMessage("Please enter valid date and time ", WarehouseApplication.Messages.MessageType.Warning); return(false); } else { ////ApprovedDate = DateTime.Parse(dateEntered + " " + timeEntered); return(true); } }
private bool ValidateGradeValue(GradingModel gm) { //if the result status is not accept able the below validation is not wanted if (gm.GradingResultStatusID != (int)GradingResultStatus.AcceptableResult) { return(true); } DataTable dt = (DataTable)ViewState["GradeList"]; DataRow[] dr = dt.Select(" Grade = '" + drpGrade.SelectedValue + "'"); int max = 0, min = 0; if (!int.TryParse(dr[0]["MaximumTotalValue"].ToString(), out max) || !int.TryParse(dr[0]["MinimumTotalValue"].ToString(), out min)) { Messages1.SetMessage("Please first specify the min and max values of the grade '" + drpGrade.SelectedItem.Text + "' in the grading setting!", Messages.MessageType.Warning); return(false); } if (gm.TotalValue >= max || gm.TotalValue < min) { Messages1.SetMessage("Total value for grade factor (" + gm.TotalValue.ToString() + ") is outside of range max(" + max.ToString() + ") and min(" + min.ToString() + ")!. For max it is exclusive.", Messages.MessageType.Error); return(false); } return(true); }
public void GetBorrowedFAList() { DateTime DispatchingDate = DateTime.Parse("1/1/1800"); if (txtSDispatchingDate.Text != "") { DispatchingDate = DateTime.Parse(txtSDispatchingDate.Text); } DateTime DispatchingDate2 = DateTime.Parse("1/1/9999"); if (txtSDispatchingDate2.Text != "") { DispatchingDate2 = DateTime.Parse(txtSDispatchingDate2.Text); } Guid ItemID = new Guid("00000000-0000-0000-0000-000000000000"); if (ddlSItem.SelectedValue != "") { ItemID = new Guid(ddlSItem.SelectedValue); } try { DataTable dt = bFixedAsset.GetBorrowedFixedAssetList(ItemID, DispatchingDate, DispatchingDate2); grvBFA.DataSource = dt; grvBFA.DataBind(); } catch (Exception ex) { Messages1.SetMessage(ex.Message, Messages.MessageType.Error); } }
protected void grvFAIV_SelectedIndexChanged(object sender, EventArgs e) { ClearControls(); Messages1.ClearMessage(); ViewState.Add("FAIVID", new Guid(grvFAIV.SelectedDataKey[0].ToString())); DataRow r = fIssueVoucher.GetFixedAssetIssueVoucher(FAIVID); try { if (isEdit != null) { ViewState.Add("isEdit", true); btnSave.Enabled = true; btnSave.Text = "Update"; BindFixedAsssetIssueVocherInfo(r); //if (!(r["SIVNo"].ToString().Equals("") && r["PRNo"].ToString().Equals(""))) // disable Editing // btnSave.Enabled = false; } else { fIssueVoucher.CancelFixedAssetIssueVoucher(FAIVID, new Guid(UserPrincipal.Current.Guid.ToString()), DateTime.Now); Messages1.SetMessage("Record canceled successfully.", Messages.MessageType.Success); GetFixedAssetIssueVoucherList(); } } catch (Exception ex) { Messages1.SetMessage(ex.Message, Messages.MessageType.Error); } }
private bool ControlsValidated() { //validate combo and grids string errorMessage = ""; if (drpShed.SelectedIndex <= 0) { errorMessage += "You must select Shed! "; } else if (drpLIC.SelectedIndex <= 0) { errorMessage += "You must select Lead Inventory Controler! "; } else if (drpInventoryControlDate.SelectedIndex <= 0) { errorMessage += "You must select Inventory Control Date!"; } if (errorMessage != string.Empty) { Messages1.SetMessage(errorMessage, Messages.MessageType.Error); return(false); } return(true); }
private void FillLIC(Guid shedID, string LICID, string CGID, string PY) { drpLIC.DataSource = null; drpLIC.Items.Clear(); drpLIC.Items.Add(new ListItem("- - Please Select LIC - -", "")); DataRow[] drs = null; if (LICID != string.Empty) { DataTable dt = InventoryControlModel.GetLIC(shedID); drs = dt.Select("ID = '" + LICID + "'"); if (drs.Count() <= 0) { Messages1.SetMessage("LIC of the PSA DO NOT exits!", Messages.MessageType.Error); } object[] obj = drs[0].ItemArray; dt.Clear(); dt.Rows.Add(obj); drpLIC.DataSource = dt; } else { drpLIC.DataSource = InventoryControlModel.GetLIC(shedID); } drpLIC.DataValueField = "ID"; drpLIC.DataTextField = "Name"; drpLIC.DataBind(); if (LICID != string.Empty && drpLIC.Items.Count > 1) { drpLIC.SelectedIndex = 1; FillInventoryDetail(new Guid(drpShed.SelectedValue), new Guid(drpLIC.SelectedValue), new Guid(CGID), PY); drpLIC.Enabled = false; } }
public void GetGRNList() { DateTime ReceiveDate = DateTime.Parse("1/1/1800"); if (txtSReceiveDate.Text != "") { ReceiveDate = DateTime.Parse(txtSReceiveDate.Text); } DateTime ReceiveDate2 = DateTime.Parse("1/1/9999"); if (txtSReceiveDate2.Text != "") { ReceiveDate2 = DateTime.Parse(txtSReceiveDate2.Text); } Guid ItemID = new Guid("00000000-0000-0000-0000-000000000000"); if (ddlSItem.SelectedValue != "") { ItemID = new Guid(ddlSItem.SelectedValue); } try { DataTable dt = grn.GetGRNList(ItemID, ReceiveDate, ReceiveDate2); ViewState.Add("dtbl", dt); grvGRN.DataSource = dt; grvGRN.DataBind(); } catch (Exception ex) { Messages1.SetMessage(ex.Message, Messages.MessageType.Error); } }
protected void btnSave_Click(object sender, EventArgs e) { Messages1.ClearMessage(); if (ControlsValidated()) { InventoryControlModel icm = SetValues(); if (icm != null) { if (icm.PSAID != null && !icm.PSAID.ToString().Equals(Guid.Empty.ToString())) { icm.SaveForPSA_Rev(); Response.Redirect("ManagerPSAApprove.aspx?approved=true"); } else { icm.Save(); Messages1.SetMessage("Inventory Adjustment was succesfully saved!", Messages.MessageType.Success); Clear(); UpdatePanel1.Update(); UpdatePanel2.Update(); } } } upMessage.Update(); }
protected void btnSearch_Click(object sender, EventArgs e) { Messages1.ClearMessage(); pnlReason44.Visible = false; txtReason.Text = ""; BindGRNCancellatiolGridview(); }
protected void GRNApprovalByLIC() { countError = 0; DateTime GRNCreationDate; string dateEntered; string timeEntered; string GRNNo; string GRN_No; Messages1.ClearMessage(); string GRNApprovalXML = "<GRNApproval>"; foreach (GridViewRow gvr in this.grvGRNApproval.Rows) { if (((CheckBox)gvr.FindControl("chkSelect")).Checked == true) { // check if date and time is not empty dateEntered = ((TextBox)grvGRNApproval.Rows[gvr.RowIndex].FindControl("txtDateTimeLICSigned")).Text; timeEntered = ((TextBox)grvGRNApproval.Rows[gvr.RowIndex].FindControl("txtTimeLICSigned")).Text; GRNNo = grvGRNApproval.DataKeys[gvr.RowIndex].Value.ToString(); GRN_No = ((Label)grvGRNApproval.Rows[gvr.RowIndex].FindControl("lblGRNNo")).Text; GRNCreationDate = DateTime.Parse(((Label)grvGRNApproval.Rows[gvr.RowIndex].FindControl("lblGRNCreatedDate")).Text); if (isValidDateTime(dateEntered, timeEntered, GRNCreationDate)) { GRNApprovalXML += "<GRNApprovalItem> <ID>" + GRNNo + "</ID>" + "<LICApprovedBy>" + UserBLL.CurrentUser.UserId + "</LICApprovedBy>" + "<LICApprovedDateTime>" + dateEntered + " " + timeEntered + "</LICApprovedDateTime>" + "<LICApprovedTimeStamp>" + DateTime.Now + "</LICApprovedTimeStamp>" + "<LICStatus>" + ((DropDownList)grvGRNApproval.Rows[gvr.RowIndex].FindControl("drpLICStatus")).SelectedValue + "</LICStatus>" + "<Status>" + 2 + "</Status>" + "</GRNApprovalItem>"; } } } if (countError == 0) { try { GRNApprovalXML += "</GRNApproval>"; GRNApprovalModel.ApproveGRN(GRNApprovalXML); BindGRNApprovalGridview(); Messages1.SetMessage("Approved successfully.", WarehouseApplication.Messages.MessageType.Success); ///////BindLIC(status); } catch (Exception ex) { Messages1.SetMessage(ex.Message, WarehouseApplication.Messages.MessageType.Error); } } else { btnApprove.Style["visibility"] = "visible"; } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { return; } BindWarehouse(); Messages1.ClearMessage(); }