Example #1
0
        private void btnApprove_Clicked(object sender, EventArgs e)
        {
            int      approvalSet     = 0;
            string   currentReqLevel = "1";
            DateTime ApproveTime     = DateTime.Now;
            string   userIP          = "";
            int      DOStatus        = 0;
            string   status          = "Approved";

            if (DOType == "ADVANCE DO")
            {
                DOStatus = ApprovalManager.UpdateAdvanceDoStatus(DocNo, LCNo, CompanyName, status);
            }
            else
            {
                DOStatus = ApprovalManager.UpdateDoStatus(DocNo, LCNo, CompanyName, status);
            }

            approvalSet = ApprovalManager.UpdateApprovalStatus(CompanyName, DocNo, currentReqLevel, getUserName, ApproveTime, userIP);

            if (approvalSet > 0)
            {
                string module      = "Sales And Marketing";
                string actionDocNo = DocNo;
                string action      = "DO  has been Approved by" + getUserName + ", DONo: " + DocNo + "";
                Admin_ActionLogManager.SendActionLog(CompanyName, action, module, getUserName, actionDocNo);
            }

            //for refreshing dashboard
            MessagingCenter.Send <App>((App)Application.Current, "OnApproval");
            //closing Popup
            ApprovalFinalizing(DocNo);
        }
Example #2
0
        private void btnApprove_Clicked(object sender, EventArgs e)
        {
            string DocumentName = "PI";

            string   SignedBy   = getUserName;
            DateTime SignedDate = DateTime.Now.Date;
            string   SignTitle  = "";
            string   SignedPCID = "";

            int insertRslt = ApprovalManager.InsertSgnatureLOg(CompanyName, DocNo, SignedBy, SignedDate, SignTitle, SignedPCID, DocumentName);

            if (insertRslt > 0)
            {
                int updateApproval = ApprovalManager.UpdatePIApprvalStatus(CompanyName, DocNo);
                getCurrentApprovalLevel = "0";
                DateTime ApproveTime = DateTime.Now.Date;
                int      approvalSet = ApprovalManager.UpdateApprovalStatus(CompanyName, DocNo, getCurrentApprovalLevel, getUserName, ApproveTime, SignedPCID);

                if (approvalSet > 0)
                {
                    string module = "Sales And Marketing";
                    string action = "New PI  has been signed digitaly, PI No: " + DocNo + "";
                    Admin_ActionLogManager.SendActionLog(CompanyName, action, module, getUserName, DocNo);
                }

                //for refreshing dashboard
                MessagingCenter.Send <App>((App)Application.Current, "OnApproval");
                //closing Popup
                ApprovalFinalizing(DocNo);
            }
        }
Example #3
0
        private void btnApprove_Clicked(object sender, EventArgs e)
        {
            string documentName = "ADV_DEL_REQ";

            DateTime reqTime     = DateTime.Now;
            DateTime ApproveTime = DateTime.Now;
            string   userIP      = "";
            bool     digitalSign = true;
            int      InqappReq   = 0;
            int      approvalSet = 0;

            string advStatus    = "Approved";
            string myAppLevel   = "";
            string nextAppLevel = "";
            string reqTo        = "";
            string reqLevel     = "";
            int    insertrslt   = 0;

            approvalSet = ApprovalManager.UpdateApprovalStatus(CompanyName, DocNo, CurrentReqLevel, getUserName, ApproveTime, userIP);

            DataTable appbodydt = InquiryApprovalManager.GetApprovalLevelhierarchy(CompanyName, CurrentReqLevel, documentName);


            if (appbodydt.Rows.Count > 0)
            {
                for (int x = 0; x < appbodydt.Rows.Count; x++)
                {
                    myAppLevel   = appbodydt.Rows[x]["ApprovalLevel"].ToString();
                    nextAppLevel = appbodydt.Rows[x]["NextLevel"].ToString();
                    reqTo        = appbodydt.Rows[x]["reqTo"].ToString();

                    reqLevel = nextAppLevel;


                    if (approvalSet > 0 && CurrentReqLevel != "3")
                    {
                        InqappReq = InquiryApprovalManager.InsertMarketingApprovalLog(CompanyName, documentName, DocNo, reqTo, reqTime, getUserName, reqLevel, userIP, digitalSign);
                    }
                    else if (approvalSet > 0 && CurrentReqLevel == "3")
                    {
                        insertrslt = ADO_Manager.UpdateAdvanceStatus(CompanyName, DocNo, advStatus);
                    }
                }
            }
            if (insertrslt != 0)
            {
                string module = "Sales And Marketing";
                string action = "Advance DO request  has been signed by " + getUserName + ", Advance No: " + DocNo + "";
                Admin_ActionLogManager.SendActionLog(CompanyName, action, module, getUserName, DocNo);
            }

            //for refreshing dashboard
            MessagingCenter.Send <App>((App)Application.Current, "OnApproval");
            //closing Popup
            ApprovalFinalizing(DocNo);
        }
Example #4
0
        private void btnApprove_Clicked(object sender, EventArgs e)
        {
            indicatorApproveProgress.IsRunning = true;
            this.IsBusy = true;


            string   documentName = "INQUIRY";
            string   currentReqLevel = "";
            string   reqTo = ""; string reqLevel = "";
            string   userIP       = "";
            DateTime reqTime      = DateTime.Now;
            DateTime ApproveTime  = DateTime.Now;
            bool     digitalSign  = true;
            int      approvalSet  = 0;
            int      InqappReq    = 0;
            string   inqAppStatus = "Approved";
            string   actionDocNo  = "";
            string   action       = "";
            string   module       = "Sales & Marketting";


            //GetApprovalLevel();

            DataTable dt = ADM.getDetailByInqCompany(CompanyName, DocNo, getUserName);

            getSellingType  = dt.Rows[0]["SellingType"].ToString();
            currentReqLevel = dt.Rows[0]["ReqLevel"].ToString();

            DataTable ApprovalBody = InquiryApprovalManager.GetApprovalLevelhierarchy(CompanyName, currentReqLevel, documentName);

            if (ApprovalBody.Rows.Count > 0)
            {
                for (int x = 0; x < ApprovalBody.Rows.Count; x++)
                {
                    getMyApprovalLevel   = ApprovalBody.Rows[x]["ApprovalLevel"].ToString();
                    getNextApprovalLevel = ApprovalBody.Rows[x]["NextLevel"].ToString();
                    reqTo = ApprovalBody.Rows[x]["reqTo"].ToString();
                }
            }

            reqLevel = getNextApprovalLevel;

            approvalSet = InquiryApprovalManager.UpdateApprovalStatus(CompanyName, DocNo, currentReqLevel, getUserName, ApproveTime, userIP);
            if (approvalSet > 0 && currentReqLevel != "5")
            {
                InqappReq = InquiryApprovalManager.InsertMarketingApprovalLog(CompanyName, documentName, DocNo, reqTo, reqTime, getUserName, reqLevel, userIP, digitalSign);
                App.Current.MainPage.Navigation.PopPopupAsync(true);
            }
            else if (approvalSet > 0 && currentReqLevel == "5")
            {
                if (getSellingType == "LC")
                {
                    InquiryApprovalManager.UpdateInquiryStatus(DocNo, CompanyName, inqAppStatus);
                }
                else
                {
                    InquiryApprovalManager.UpdateCashInquiryStatus(DocNo, CompanyName, inqAppStatus);
                }
            }

            actionDocNo = DocNo;
            action      = "Inquiry  has been signed by " + getUserName + ", Inquiry No: " + DocNo + "";
            Admin_ActionLogManager.SendActionLog(CompanyName, action, module, getUserName, actionDocNo);

            //for refreshing dashboard
            MessagingCenter.Send <App>((App)Application.Current, "OnApproval");
            //closing Popup
            ApprovalFinalizing(getMyApprovalLevel, actionDocNo);
        }