Пример #1
0
        protected void GetReceiptHeadByIssueID()
        {
            iPartReceiptClient objService = new iPartReceiptClient();

            try
            {
                PORtGRNHead   ReceiptHead = new PORtGRNHead();
                CustomProfile profile     = CustomProfile.GetProfile();
                ReceiptHead = objService.GetReceiptHeadByIssueID(Convert.ToInt64(Session["PORIssueID"].ToString()), profile.DBConnection._constr);
                if (ReceiptHead != null)
                {
                    //Session["PORIssueID"] = ReceiptHead.ReferenceID.Value.ToString();
                    //GetRequest_n_IssueHeadByIssueID();
                    hdnReceiptID.Value  = ReceiptHead.GRNH_ID.ToString();
                    lblReceiptNo.Text   = ReceiptHead.GRNH_ID.ToString();
                    UC_ReceiptDate.Date = DateTime.Now;
                    if (ReceiptHead.GRN_Date != null)
                    {
                        UC_ReceiptDate.Date = ReceiptHead.GRN_Date;
                    }
                    ddlStatus.SelectedIndex = ddlStatus.Items.IndexOf(ddlStatus.Items.FindByValue(ReceiptHead.StatusID.Value.ToString()));
                    if (ReceiptHead.ReceivedByUserID != 0)
                    {
                        ddlReceivedBy.SelectedIndex = ddlReceivedBy.Items.IndexOf(ddlReceivedBy.Items.FindByValue(ReceiptHead.ReceivedByUserID.Value.ToString()));
                    }
                    txtReceiptRemark.Text  = ReceiptHead.Remark;
                    GridReceipt.DataSource = objService.GetReceiptPartDetailByReceiptID(ReceiptHead.GRNH_ID, Convert.ToInt64(hdnSiteID.Value), Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, "true", profile.DBConnection._constr);
                    GridReceipt.DataBind();
                    divDisabled();
                }
            }
            catch { }
            finally { objService.Close(); }
        }
        protected void FillGVRequest(string FillBy)
        {
            iPartReceiptClient objServie = new iPartReceiptClient();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                GVReceipt.DataSource = null;
                GVReceipt.DataBind();
                if (FillBy == "UserID")
                {
                    GVReceipt.DataSource = objServie.GetReceiptSummaryByUserID(profile.Personal.UserID, profile.DBConnection._constr);
                }
                else if (FillBy == "SiteID")
                {
                    GVReceipt.DataSource = objServie.GetReceiptSummaryBySiteIDs(Session["SiteIDs"].ToString(), profile.DBConnection._constr);
                }
                else if (FillBy == "RequestID")
                {
                    GVReceipt.DataSource = objServie.GetReceiptSummaryByRequestID(Convert.ToInt64(Session["PORRequestID"].ToString()), profile.DBConnection._constr);
                }
                GVReceipt.DataBind();
            }
            catch { }
            finally { objServie.Close(); }
        }
Пример #3
0
        public static string WMSaveReceiptHead(object objReceipt)
        {
            HttpContext.Current.Session.Remove("PORIssueID");

            string             result     = "";
            iPartReceiptClient objService = new iPartReceiptClient();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();

                PORtGRNHead ReceiptHead = new PORtGRNHead();
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary = (Dictionary <string, object>)objReceipt;

                if (HttpContext.Current.Session["PORReceiptID"] != null)
                {
                    if (HttpContext.Current.Session["PORReceiptID"] == "0")
                    {
                        ReceiptHead.CreatedBy  = profile.Personal.UserID;
                        ReceiptHead.CreationDt = DateTime.Now;
                    }
                    else
                    {
                        ReceiptHead = objService.GetReceiptHeadByReceiptID(Convert.ToInt64(HttpContext.Current.Session["PORReceiptID"]), profile.DBConnection._constr);
                        ReceiptHead.LastModifiedBy = profile.Personal.UserID;
                        ReceiptHead.LastModifiedDt = DateTime.Now;
                    }

                    ReceiptHead.SiteID           = Convert.ToInt64(dictionary["SiteID"]);
                    ReceiptHead.ObjectName       = dictionary["ObjectName"].ToString();
                    ReceiptHead.ReferenceID      = Convert.ToInt64(dictionary["ReferenceID"].ToString());
                    ReceiptHead.GRN_No           = "N/A";
                    ReceiptHead.GRN_Date         = Convert.ToDateTime(dictionary["GRN_Date"].ToString());
                    ReceiptHead.ReceivedByUserID = Convert.ToInt64(dictionary["ReceivedByUserID"]);
                    ReceiptHead.StatusID         = Convert.ToInt64(dictionary["StatusID"]);
                    ReceiptHead.Remark           = dictionary["Remark"].ToString();
                    ReceiptHead.IsSubmit         = Convert.ToBoolean(dictionary["IsSubmit"]);

                    long   ReceiptID = objService.SetIntoGRNHead(ReceiptHead, profile.DBConnection._constr);
                    string status    = "";
                    if (ReceiptHead.StatusID == 8)
                    {
                        status = "Received";
                    }
                    if (ReceiptID > 0)
                    {
                        objService.FinalSaveReceiptPartDetail(HttpContext.Current.Session.SessionID, ObjectName, ReceiptID, profile.Personal.UserID.ToString(), status, profile.DBConnection._constr);
                        result = "Material Receipt record saved successfully";
                    }
                }
            }
            catch { result = "Some error occurred"; }
            finally { objService.Close(); }
            return(result);
        }
Пример #4
0
        public static PORtGRNHead WMGetReceiptHead()
        {
            iPartReceiptClient objService  = new iPartReceiptClient();
            PORtGRNHead        ReceiptHead = new PORtGRNHead();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                objService.ClearTempDataFromDB(HttpContext.Current.Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr);
                ReceiptHead = objService.GetReceiptHeadByReceiptID(Convert.ToInt64(HttpContext.Current.Session["PORReceiptID"].ToString()), profile.DBConnection._constr);
            }
            catch { }
            finally { objService.Close(); }
            return(ReceiptHead);
        }
Пример #5
0
        public static string[] WMUpdateReceiptQty(object objReceipt)
        {
            string[]           QtyResult  = new string[] { };
            iPartReceiptClient objService = new iPartReceiptClient();

            try
            {
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary = (Dictionary <string, object>)objReceipt;
                CustomProfile profile = CustomProfile.GetProfile();

                POR_SP_GetPartDetails_OfGRN_Result ReceiptRec = new POR_SP_GetPartDetails_OfGRN_Result();
                ReceiptRec.Sequence    = Convert.ToInt64(dictionary["Sequence"]);
                ReceiptRec.ReceivedQty = Convert.ToDecimal(dictionary["ReceivedQty"]);
                QtyResult = objService.UpdatePartReceipt_TempData(HttpContext.Current.Session.SessionID, ObjectName, profile.Personal.UserID.ToString(), ReceiptRec, profile.DBConnection._constr);
            }
            catch { }
            finally { objService.Close(); }
            return(QtyResult);
        }
Пример #6
0
        protected void GridReceipt_OnRebind(object sender, EventArgs e)
        {
            iPartReceiptClient objService = new iPartReceiptClient();

            try
            {
                GridReceipt.DataSource = null;
                GridReceipt.DataBind();
                CustomProfile profile = CustomProfile.GetProfile();
                if (hdnReceiptID.Value != "0" && hdnReceiptID.Value != "")
                {
                    GridReceipt.DataSource = objService.GetReceiptPartDetailByReceiptID(Convert.ToInt64(hdnReceiptID.Value), Convert.ToInt64(hdnSiteID.Value), Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, "", profile.DBConnection._constr);
                }
                else if (hdnIssueID.Value != "0" && hdnIssueID.Value != "")
                {
                    GridReceipt.DataSource = objService.GetReceiptPartDetailByIssueID(Convert.ToInt64(hdnIssueID.Value), Convert.ToInt64(hdnSiteID.Value), Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr);
                }
                GridReceipt.DataBind();
            }
            catch { }
            finally { objService.Close(); }
        }
Пример #7
0
        protected void FillStatus()
        {
            string             state      = HttpContext.Current.Session["PORstate"].ToString();
            iPartReceiptClient objService = new iPartReceiptClient();
            List <BrilliantWMS.PORServicePartReceipts.mStatu> StatusList = new List <BrilliantWMS.PORServicePartReceipts.mStatu>();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                StatusList = objService.GetStatusListForGRN("All,Receipt", state, profile.Personal.UserID, profile.DBConnection._constr).ToList();

                BrilliantWMS.PORServicePartReceipts.mStatu select = new BrilliantWMS.PORServicePartReceipts.mStatu()
                {
                    ID = 0, Status = "-Select-"
                };
                StatusList.Insert(0, select);
                ddlStatus.DataSource = null;
                ddlStatus.DataBind();
                ddlStatus.DataSource = StatusList;
                ddlStatus.DataBind();
            }
            catch { }
            finally { objService.Close(); }
        }
        public void GetDefaultConsumptionfromRequestHead()
        {
            iPartRequestClient     objRequestService     = new iPartRequestClient();
            iPartIssueClient       objIssueService       = new iPartIssueClient();
            iPartReceiptClient     objReceiptService     = new iPartReceiptClient();
            iPartConsumptionClient objConsumptionService = new iPartConsumptionClient();

            try
            {
                HttpContext.Current.Session["PORConsumptionID"] = "0";
                CustomProfile profile = CustomProfile.GetProfile();
                if (Session["PORReceiptID"] != null)
                {
                    if (Session["PORReceiptID"].ToString() != "0")
                    {
                        PORtGRNHead         ReceiptHead = new PORtGRNHead();
                        PORtMINHead         IssueHead   = new PORtMINHead();
                        PORtPartRequestHead RequestHead = new PORtPartRequestHead();
                        ReceiptHead = objReceiptService.GetReceiptHeadByReceiptID(Convert.ToInt64(Session["PORReceiptID"].ToString()), profile.DBConnection._constr);
                        if (ReceiptHead != null)
                        {
                            IssueHead = objIssueService.GetIssueHeadByIssueID(Convert.ToInt64(ReceiptHead.ReferenceID), profile.DBConnection._constr);
                        }
                        if (IssueHead != null)
                        {
                            RequestHead = objRequestService.GetRequestHeadByRequestID(Convert.ToInt64(IssueHead.PRH_ID), profile.DBConnection._constr);
                        }

                        if (RequestHead != null)
                        {
                            ddlSites.SelectedIndex  = ddlSites.Items.IndexOf(ddlSites.Items.FindByValue(RequestHead.SiteID.ToString()));
                            UC_DateConsumption.Date = DateTime.Now;
                            ddlStatus.SelectedIndex = 1;

                            ddlConsumedBy.DataSource = null;
                            ddlConsumedBy.DataBind();
                            ddlConsumedBy.DataSource = WMFillUserList(Convert.ToInt64(RequestHead.SiteID));
                            ddlConsumedBy.DataBind();
                            ddlConsumedBy.SelectedIndex = ddlConsumedBy.Items.IndexOf(ddlConsumedBy.Items.FindByValue(profile.Personal.UserID.ToString()));

                            ddlContainer.DataSource = null;
                            ddlContainer.DataBind();

                            ddlContainer.DataSource = WMFillEnginList(Convert.ToInt64(RequestHead.SiteID));
                            ddlContainer.DataBind();
                            ddlContainer.SelectedIndex = ddlContainer.Items.IndexOf(ddlContainer.Items.FindByText(RequestHead.Container.ToString()));

                            lblEngineModel.Text  = RequestHead.EngineModel.ToString();
                            lblEngineSerial.Text = RequestHead.EngineSerial.ToString();

                            txtFailureHours.Text  = RequestHead.FailureHours.ToString();
                            txtFailureCause.Text  = RequestHead.FailureCause.ToString();
                            txtFailureNature.Text = RequestHead.FailureNature.ToString();

                            FillPartDetailByReceiptID(Convert.ToInt64(Session["PORReceiptID"].ToString()));
                        }
                    }
                }
            }
            catch { }
            finally
            {
                objRequestService.Close();
                objIssueService.Close();
                objReceiptService.Close();
            }
        }