protected void btnSearch_Click(object sender, EventArgs e) { try { IChallanBLL aChallanBll = new IChallanBLL(); if (txtbxToDate.Text.Trim() == "") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Please Input To Date')", true); } else if (txtbxFromDate.Text.Trim() == "") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Please Input From Date')", true); } else { DateTime Todate = Convert.ToDateTime(txtbxToDate.Text); DateTime Fromdate = Convert.ToDateTime(txtbxFromDate.Text); LoadGrdview(Todate, Fromdate); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }
protected void btnSearch_Click(object sender, EventArgs e) { try { if (txtbxToDate.Text.Trim() == "") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Please Input To Date!')", true); } else if (txtbxFromDate.Text.Trim() == "") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Please Input From Date!')", true); } else { IChallanBLL aChallanBll = new IChallanBLL(); DateTime Todate = Convert.ToDateTime(txtbxToDate.Text); DateTime Fromdate = Convert.ToDateTime(txtbxFromDate.Text); List <DeleveryProductR> DeleveryProductes = aChallanBll.GetDeleveryProductList(Todate, Fromdate); if (DeleveryProductes.Count > 0) { GrdviewAfterDeiveryProduct.DataSource = DeleveryProductes; GrdviewAfterDeiveryProduct.DataBind(); } else { GrdviewAfterDeiveryProduct.DataSource = null; GrdviewAfterDeiveryProduct.DataBind(); } } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }
private string GetGinID(string DepartmentCode) { IChallanBLL aChallanBll = new IChallanBLL(); DataTable dt = new DataTable(); string Gin = ""; Gin = aChallanBll.GetNewChalanNo(DepartmentCode, DateTime.Now, "DPT"); return(Gin); }
private void LoadGrdview(DateTime Todate, DateTime Fromdate) { try { IChallanBLL aChallanBll = new IChallanBLL(); List <POReceivedR> POReceivedRes = aChallanBll.ReceivebyPoSerchByDatetoDate(Todate, Fromdate); if (POReceivedRes.Count > 0) { GrdviewAfterDeiveryProduct.DataSource = POReceivedRes; GrdviewAfterDeiveryProduct.DataBind(); } else { GrdviewAfterDeiveryProduct.DataSource = null; GrdviewAfterDeiveryProduct.DataBind(); ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('No Data Found!')", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }
protected void btnTransfer_Click(object sender, EventArgs e) { try { IChallanBLL aChallanBll = new IChallanBLL(); List <DeleveryProductR> deleveryProducts = new List <DeleveryProductR>(); string OCODE = ((SessionUser)Session["SessionUser"]).OCode; bool status = true; bool CheckStatus = false; foreach (GridViewRow gvRow in grdstoreReqDelivery.Rows) { CheckBox rowChkBox = ((CheckBox)gvRow.FindControl("rowLevelCheckBox")); if (rowChkBox.Checked == true) { CheckStatus = true; } } if (CheckStatus) { foreach (GridViewRow gvRow in grdstoreReqDelivery.Rows) { CheckBox rowChkBox = ((CheckBox)gvRow.FindControl("rowLevelCheckBox")); if (rowChkBox.Checked == true) { TextBox txtbxReceive = (TextBox)gvRow.FindControl("txtbxReceiveAmount"); if (txtbxReceive.Text != "") { Label lblLastRceceive = ((Label)gvRow.FindControl("lblLastReceive")); double lastReceive = Convert.ToDouble(lblLastRceceive.Text); double ReceiveQty = Convert.ToDouble(txtbxReceive.Text); Label lblOrderQty = ((Label)gvRow.FindControl("lblHeadApproveQuanity")); double Poqty = Convert.ToDouble(lblOrderQty.Text); if (ReceiveQty == 0) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Please Check Quantity!')", true); status = false; break; } else if (ReceiveQty + lastReceive > Poqty) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Please Check Quantity!')", true); status = false; break; } } else { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Please Input Receive Qty!')", true); status = false; break; } } } if (status) { foreach (GridViewRow gvRow in grdstoreReqDelivery.Rows) { CheckBox rowChkBox = ((CheckBox)gvRow.FindControl("rowLevelCheckBox")); DeleveryProductR _aitem = new DeleveryProductR(); if (rowChkBox.Checked == true) { TextBox txtbxReceive = (TextBox)gvRow.FindControl("txtbxReceiveAmount"); TextBox txtRemarks = (TextBox)gvRow.FindControl("txtRemarks"); Label lblBarCode = ((Label)gvRow.FindControl("lblBarCode")); Label lblDepartmentCOde = ((Label)gvRow.FindControl("lblDepartmentCode")); Label lblReqNo = ((Label)gvRow.FindControl("lblDReqNo")); Label lblID = ((Label)gvRow.FindControl("lblID")); Label lblHeadApproveQuantity = ((Label)gvRow.FindControl("lblHeadApproveQuanity")); double ApproveQty = Convert.ToDouble(lblHeadApproveQuantity.Text); double ReceiveQty = Convert.ToDouble(txtbxReceive.Text); Label lblLastRceceive = ((Label)gvRow.FindControl("lblLastReceive")); double lastReceive = Convert.ToDouble(lblLastRceceive.Text); Label lblProgramId = ((Label)gvRow.FindControl("lblProgramId")); int ProgramId = Convert.ToInt32(lblProgramId.Text); DropDownList ddlStoreList = (DropDownList)gvRow.FindControl("ddlStoreList"); DropDownList ddlStyle = (DropDownList)gvRow.FindControl("ddlStyle"); DropDownList ddlProgram = (DropDownList)gvRow.FindControl("ddlProgram"); if (ddlStoreList.SelectedValue != "0" && ddlStoreList.SelectedValue == "CNT") { _aitem.StoreCode = ddlStoreList.SelectedValue.ToString(); _aitem.HeadApproveQty = ReceiveQty; _aitem.BarCode = Convert.ToInt16(lblBarCode.Text); _aitem.ReqNo = lblReqNo.Text; _aitem.DeliveryType = "CentralToDepartment"; _aitem.ChallanNo = aChallanBll.GetNewChalanNo(OCODE, DateTime.Now, "DPT"); _aitem.TransferDate = DateTime.Now; _aitem.DPT_CODE = lblDepartmentCOde.Text; _aitem.EID = hidEid.Value; _aitem.ProgramId = ProgramId; _aitem.CurrentCompanyCode = "0"; _aitem.ID = Convert.ToInt16(lblID.Text); _aitem.OldCompanyCode = ddlStoreList.SelectedValue.ToString(); //((SessionUser)Session["SessionUser"]).OCode.ToString(); _aitem.OCode = ((SessionUser)Session["SessionUser"]).OCode.ToString(); _aitem.StyleId = Convert.ToInt32(ddlStyle.SelectedValue); _aitem.Remarks = txtRemarks.Text; } else { _aitem.StoreCode = ddlStoreList.SelectedValue.ToString(); _aitem.HeadApproveQty = ReceiveQty; _aitem.BarCode = Convert.ToInt16(lblBarCode.Text); _aitem.ReqNo = lblReqNo.Text; _aitem.DeliveryType = "OthersToDepartment"; _aitem.ChallanNo = hidGin.Value; _aitem.TransferDate = DateTime.Now; _aitem.DPT_CODE = lblDepartmentCOde.Text; _aitem.EID = hidEid.Value; _aitem.ProgramId = ProgramId; _aitem.CurrentCompanyCode = "0"; _aitem.ID = Convert.ToInt16(lblID.Text); _aitem.OldCompanyCode = ddlStoreList.SelectedValue.ToString(); //((SessionUser)Session["SessionUser"]).OCode.ToString(); _aitem.OCode = ((SessionUser)Session["SessionUser"]).OCode.ToString(); _aitem.StyleId = Convert.ToInt32(ddlStyle.SelectedValue); _aitem.Remarks = txtRemarks.Text; } deleveryProducts.Add(_aitem); if (lastReceive == 0 && ReceiveQty == Convert.ToDouble(lblHeadApproveQuantity.Text)) { string ReqNo = lblReqNo.Text; int Id = Convert.ToInt16(lblID.Text); aChallanBll.UpdateReqStatus(ReqNo, Id, ReceiveQty); // PurchaseOrderBll.PurchaseDone(aChallanBll); // PurchaseOrderBll.UpdateLastQty(id, ReceiveQty); } else if ((Convert.ToDouble(lblHeadApproveQuantity.Text) == ReceiveQty + Convert.ToDouble(lastReceive))) { string ReqNo = lblReqNo.Text; int Id = Convert.ToInt16(lblID.Text); ReceiveQty = ReceiveQty + Convert.ToDouble(lastReceive); aChallanBll.UpdateReqStatus(ReqNo, Id, ReceiveQty); //PurchaseOrderBll.UpdateLastQty(id, ReceiveQty); // PurchaseOrderBll.PurchaseDone(id); // PurchaseOrderBll.UpdateLastQty(id, ReceiveQty); } else { string ReqNo = lblReqNo.Text; int Id = Convert.ToInt16(lblID.Text); ReceiveQty = ReceiveQty + Convert.ToDouble(lastReceive); aChallanBll.UpdateReqStatusLastReceive(ReqNo, Id, ReceiveQty); } } } int result = aChallanBll.UpdateInvByCentral_FIFO(deleveryProducts); // int result = aChallanBll.DeliverProductByRequisitionWithStore(deleveryProducts); if (result == 1) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('GIN Issued Successfully')", true); tGetAll_DistinctApprovedStoreReq(); ResetgrdstoreReqDelivery(); } } } else { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Please Select Item!')", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }