Ejemplo n.º 1
0
    protected void OnStsSavedSentToApprover(object s, EventArgs e)
    {
        try
        {
            TechnicalBAL objpurc    = new TechnicalBAL();
            TechnicalBAL objTechBAL = new TechnicalBAL();

            //qtnbased
            DataTable dtQuotations    = BLL_PURC_Common.PURC_GET_Quotation_ByReqsnCode(Requisitioncode);
            DataTable dtQuotationList = new DataTable();
            dtQuotationList.Columns.Add("Qtncode");
            dtQuotationList.Columns.Add("amount");

            foreach (DataRow dr in dtQuotations.Rows)
            {
                if (dr["active_PO"].ToString() == "0") // for those POs have been cancelled(means active_PO is zero)
                {
                    DataRow dtrow = dtQuotationList.NewRow();
                    dtrow[0] = dr["QUOTATION_CODE"].ToString();
                    dtrow[1] = "0";
                    dtQuotationList.Rows.Add(dtrow);
                }
            }

            // save the requested qty into order qty and order qty column on grid will be bibnded to order qty (change so store the updated qty by supp at the time of eval.) { this functionality has been implemented at rfq send stage}
            // code to update the order qty have been commented ,this is used to save bgt code only.

            BLL_PURC_Common.Update_OrderQty_From_ReqstQty(Requisitioncode, Document_Code, ddlBGTCodeToSuppdt.SelectedValue);

            int stsEntry = objTechBAL.InsertUserApprovalEntries(Requisitioncode, Document_Code, Vessel_Code, User, ucApprovalUserToSuppdt.ApproverID, 0, 0, "", ucApprovalUserToSuppdt.Remark, dtQuotationList);
            if (stsEntry > 0)
            {
                // dtQuotationList is passing but not using in sp ,all quotation will be set as senttosuppdt as true for this reqsn
                int res = objpurc.PURC_Update_SentToSupdt(0, 0, Requisitioncode, int.Parse(User), ucApprovalUserToSuppdt.Remark, dtQuotationList);

                if (res > 0)
                {
                    BLL_PURC_Purchase objPurc = new BLL_PURC_Purchase();
                    //Requisition stage status update
                    objPurc.InsertRequisitionStageStatus(Requisitioncode, Vessel_Code, Document_Code, "QEV", " ", Convert.ToInt32(User), dtQuotationList);
                    BLL_PURC_Common.INS_Remarks(Document_Code, Convert.ToInt32(User), ucApprovalUserToSuppdt.Remark, 302);

                    String msg = String.Format("alert('Sent successfully'); RefreshPendingDetails();window.close();");
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Ejemplo n.º 2
0
    protected void OnStsSaved(object s, EventArgs e)
    {
        try
        {
            TechnicalBAL objTechBAL = new TechnicalBAL();
            TechnicalBAL objpurc    = new TechnicalBAL();

            // reqsncode will be set to "" in uc after update
            string[] prm = HiddenFieldSuppdtRemark.Value.Split(new char[] { ',' });

            DataTable dtQuotations = BLL_PURC_Common.PURC_GET_Quotation_ByReqsnCode(prm[2].ToString());

            DataTable dtQuotationList = new DataTable();
            dtQuotationList.Columns.Add("Qtncode");
            dtQuotationList.Columns.Add("amount");

            foreach (DataRow dr in dtQuotations.Rows)
            {
                if (dr["active_PO"].ToString() == "0") // for those POs have been cancelled(means active_PO is zero)
                {
                    DataRow dtrow = dtQuotationList.NewRow();
                    dtrow[0] = dr["QUOTATION_CODE"].ToString();
                    dtrow[1] = "0";
                    dtQuotationList.Rows.Add(dtrow);
                }
            }
            // save the requested qty into order qty and order qty column on grid will be binded to order qty (change so store the updated qty by supp at the time of eval.) { this functionality has been implemented at rfq send stage}
            // code to update the order qty have been commented ,this is used to save bgt code only.
            //
            //BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase();
            //int retval = 0;
            //if (Session["BudgetDetails"] != null)
            //{
            //    retval = objTechService.Check_Update_BudgetCode(prm[2].ToString(), prm[3].ToString(), ddlBudgetCode.SelectedValue);
            //}
            //else
            //{
            BLL_PURC_Common.Update_OrderQty_From_ReqstQty(prm[2].ToString(), prm[3].ToString(), ddlBudgetCode.SelectedValue);
            //}

            //qtnbased
            int stsEntry = objTechBAL.InsertUserApprovalEntries(prm[2].ToString(), prm[3].ToString(), prm[4].ToString(), Session["userid"].ToString(), ucApprovalUser1.ApproverID, 0, 0, "", ucApprovalUser1.Remark, dtQuotationList);
            if (stsEntry > 0)
            {
                // dtQuotationList is passing but not using in sp ,all quotation will be set as senttosuppdt as true for this reqsn
                int res = objpurc.PURC_Update_SentToSupdt(int.Parse(prm[0]), int.Parse(prm[1]), prm[2].ToString(), int.Parse(Session["USERID"].ToString()), ucApprovalUser1.Remark, dtQuotationList);


                if (res > 0)
                {
                    BLL_PURC_Purchase objPurc = new BLL_PURC_Purchase();
                    //Requisition stage status update and remark
                    objPurc.InsertRequisitionStageStatus(prm[2].ToString(), prm[4].ToString(), prm[3].ToString(), "QEV", " ", Convert.ToInt32(Session["USERID"]), dtQuotationList);
                    BLL_PURC_Common.INS_Remarks(prm[3].ToString(), Convert.ToInt32(Session["userid"].ToString()), ucApprovalUser1.Remark, 302);

                    divOnHold.Visible    = false;
                    divReqStages.Visible = false;

                    ucCustomPagerItems.isCountRecord = 1;
                    BindData();
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }