protected void grdRequest_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            GridView grd              = sender as GridView;
            int      orgID            = int.Parse(grd.SelectedRow.Cells[0].Text);
            int      tippaniID        = int.Parse(grd.SelectedRow.Cells[1].Text);
            int      tippaniProcessID = int.Parse(grd.SelectedRow.Cells[2].Text);

            this.hdnTippaniStatus.Value = grd.SelectedRow.Cells[13].Text;

            List <ATTGeneralTippaniSummary> lst = BLLGeneralTippaniDetail.GetLeaveTippaniDetail(orgID, tippaniID, tippaniProcessID, LeaveMode.Recommend);

            this.ClearLeaveDetail();
            this.SetLeaveRecommendList();

            this.grdRecommendation.DataSource = "";
            this.grdRecommendation.DataBind();

            this.grdLeave.DataSource = lst;
            this.grdLeave.DataBind();

            this.grdLeaveDetail.DataSource = lst;
            this.grdLeaveDetail.DataBind();

            if (this.hdnForm.Value == "0")
            {
                this.ddlDStatus_Rqd.Enabled = true;
                this.btnSendBack.Enabled    = true;
                this.btnSubmit.Enabled      = true;

                if (this.TippaniRequestViewer.IsValidForSending == true)
                {
                    this.txtNote.Text           = BLLGeneralTippaniProcess.GetTippaniText(orgID, tippaniID, tippaniProcessID);
                    this.btnSaveAsDraft.Enabled = true;
                }
            }
            else if (this.hdnForm.Value == "1")
            {
                this.ddlDStatus_Rqd.Enabled = false;
                this.btnSendBack.Enabled    = false;
                this.btnSubmit.Enabled      = false;
                this.btnSaveAsDraft.Enabled = false;
            }

            ATTGeneralTippaniRequestInfo info = new ATTGeneralTippaniRequestInfo();
            info.OrgID       = orgID;
            info.TippaniID   = tippaniID;
            info.RequestType = TippaniProcessRequestType.History;

            this.TippaniHistory.ProcessID = tippaniProcessID;
            this.TippaniHistory.LoadTippaniHistory(info);
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }
    protected void btnSendBack_Click(object sender, EventArgs e)
    {
        if (this.IsTippaniValidate() == false)
        {
            return;
        }

        if (this.TippaniRequestViewer.GrdRequestViewer.SelectedRow.Cells[13].Text == "3" || this.TippaniRequestViewer.GrdRequestViewer.SelectedRow.Cells[13].Text == "4")
        {
            this.lblStatusMessage.Text = "तपाईले Final approve भएको टिप्पणीमा काम गर्न सक्नुहुन्न।";
            this.programmaticModalPopup.Show();
            return;
        }

        ATTGeneralTippaniProcess updateProcess = new ATTGeneralTippaniProcess();

        if (this.hdnForm.Value == "0")
        {
            /* created update process */
            updateProcess        = this.TippaniRequestViewer.GetSelfActorProcess();
            updateProcess.Note   = this.txtNote.Text;
            updateProcess.Status = int.Parse(this.ddlDStatus_Rqd.SelectedValue);
        }
        else if (this.hdnForm.Value == "1")
        {
            updateProcess = null;
        }

        /* created sendback process */
        ATTGeneralTippaniProcess process = this.TippaniRequestViewer.GetSendBackProcess();

        List <ATTGeneralTippaniProcess> lstProcess = new List <ATTGeneralTippaniProcess>();

        lstProcess.Add(process);

        List <ATTGeneralTippaniAttachment> lstAttachment = this.TippaniAttachment.GetAttachment(process.OrgID, process.TippaniID, this.User.UserName);

        foreach (ATTGeneralTippaniAttachment attachment in lstAttachment)
        {
            attachment.TippaniID        = process.TippaniID;
            attachment.TippaniProcessID = process.TippaniProcessID;
        }

        try
        {
            BLLGeneralTippaniProcess.UpdateChannelPersonDecisionAndAddProcess(updateProcess, lstProcess, lstAttachment, this.TippaniRequestViewer.TippaniSubjectType);
            this.ClearME();

            this.lblStatusMessage.Text = "Tippani send back successfully.";
            this.programmaticModalPopup.Show();
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }
    public void LoadCommitteeMemberDetail(int orgID, int tippaniID, int tipPrcID)
    {
        this.SetCommitteeMemberSessionList();
        ATTCommitteeByTippani committee = null;

        try
        {
            committee = BLLCommitteeByTippani.GetCommitteeByTippaniByTIDs(orgID, tippaniID);
            if (committee == null)
            {
                this.lblStatusMessage.Text = "Error:: Zero object or multiple objects are selected.<br>Please check the system.";
                this.programmaticModalPopup.Show();
                return;
            }
            else
            {
                this.ddlOrg_Rqd.SelectedValue = committee.CommitteeOrgID.ToString();
                this.txtCommittee_Rqd.Text    = committee.CommitteeName;
                this.txtDesc.Text             = committee.Description;
            }
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }

        try
        {
            List <ATTGeneralTippaniSummary> lst = BLLGeneralTippaniDetail.GetCommitteeTippaniDetail(orgID, tippaniID);

            foreach (ATTGeneralTippaniSummary summary in lst)
            {
                this.CommitteeMemberList.Add(summary);
            }
            this.grdCommittee.DataSource = this.CommitteeMemberList;
            this.grdCommittee.DataBind();

            this.txtNote.Text = BLLGeneralTippaniProcess.GetTippaniText(orgID, tippaniID, tipPrcID);
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }

        this.hdnIDs.Value       = committee.CommitteeOrgID.ToString() + "/" + committee.CommitteeID.ToString();
        this.ddlOrg_Rqd.Enabled = false;
    }
Exemple #4
0
    public void LoadDeputationDetail(int orgID, int tippaniID, int tipPrcID)
    {
        this.SetDeputationListSession();
        try
        {
            List <ATTGeneralTippaniSummary> lst = BLLGeneralTippaniDetail.GetDeputationTippaniDetail(orgID, tippaniID);
            foreach (ATTGeneralTippaniSummary summary in lst)
            {
                this.DeputationList.Add(summary);
            }
            this.grdDeputation.DataSource = this.DeputationList;
            this.grdDeputation.DataBind();

            this.txtNote.Text = BLLGeneralTippaniProcess.GetTippaniText(orgID, tippaniID, tipPrcID);
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //ATTUserLogin user = ((ATTUserLogin)Session["Login_User_Detail"]);

        if (!IsPostBack)
        {
            if (Request.UrlReferrer != null && Path.GetFileName(Request.UrlReferrer.ToString()).ToUpper() == "TIPPANIDETAILSEARCH.ASPX" && Session["tippani_mode"] != null)
            {
                string action = "E";
                this.hdnMode.Value = action;

                string composite = Session["tippani_mode"].ToString();
                char[] token     = { '/' };

                int orgID     = int.Parse(composite.Split(token)[0]);
                int tippaniID = int.Parse(composite.Split(token)[1]);
                int tipPrcID  = int.Parse(composite.Split(token)[2]);

                this.hdnIDs.Value = orgID.ToString() + "/" + tippaniID.ToString() + "/" + tipPrcID.ToString();

                Session["tippani_mode"] = null;

                this.Tippani.ActionMode = action;
                this.Tippani.LoadTippaniDetail(orgID, tippaniID);

                this.VisitTippani.ActionMode = action;
                this.VisitTippani.LoadVisitDetail(orgID, tippaniID, 1);

                this.TippaniAttachment.ActionMode = action;
                this.TippaniAttachment.LoadTippaniAttachmentDetail(orgID, tippaniID);

                //status = -1 --> tippani channel visible, channel person not added
                //status = 0 --> tippani channel invisible, channel person added
                //status > 0 --> tippani has been modified by next person so not editable
                int status = BLLGeneralTippaniProcess.GetTippaniNextStatus(orgID, tippaniID, 2);
                if (status <= -1)
                {
                    this.chnlPerson.Visible = true;
                }
                else if (status == 0)
                {
                    this.chnlPerson.Visible  = false;
                    this.lblFinalStatus.Text = "यो टिप्पणी पठाइसकेको हुनाले सिफारीस कर्त्ता / प्रमाणित कर्ता छान्नसक्नु हुन्न तर Submit गर्न सक्नुहुन्छ।";
                }
                else if (status > 0)
                {
                    this.btnSubmit.Enabled   = false;
                    this.lblFinalStatus.Text = "यस टिप्पणीमा, टिप्पणी पाउने व्यक्तिले काम गरिसकेको हुनाले Submit गर्न सक्नुहुन्न।";
                }
            }
            //else if (Request.UrlReferrer != null && Path.GetFileName(Request.UrlReferrer.ToString()).ToUpper() == "MESSAGEVIEW.ASPX" && Session["tippani_from_message"] != null)
            else if (Session["tippani_from_message"] != null)
            {
                this.lblConfirmation.Text = "यो टिप्पणी message बाट उठाएको हो ।";
                string composite = Session["tippani_from_message"].ToString();
                Session["tippani_from_message"] = null;
                char[] token = { '/' };

                int orgID = int.Parse(composite.Split(token)[0]);
                int msgID = int.Parse(composite.Split(token)[1]);

                this.hdnMsgIDs.Value = orgID.ToString() + "/" + msgID.ToString();

                this.TippaniAttachment.ActionMode = "E";
                this.TippaniAttachment.LoadAttachmentFromMessage(orgID, msgID);

                this.VisitTippani.LoadBodyFromMessage(orgID, msgID);
            }
            //else if (Request.UrlReferrer != null && Path.GetFileName(Request.UrlReferrer.ToString()).ToUpper() == "MESSAGEVIEW.ASPX" && Session["tippani_from_message"] != null)
            else if (Session["tippani_from_Dartaa_chalaani"] != null)
            {
                this.lblConfirmation.Text = "यो टिप्पणी Dartaa Chalaani बाट उठाएको हो ।";
                string composite = Session["tippani_from_Dartaa_chalaani"].ToString();
                Session["tippani_from_Dartaa_chalaani"] = null;
                char[] token = { '_' };

                int    orgID   = int.Parse(composite.Split(token)[0]);
                string regDate = composite.Split(token)[1];
                int    regNo   = int.Parse(composite.Split(token)[2]);

                this.hdnDarIDs.Value = orgID.ToString() + "_" + regDate + "_" + regNo.ToString();

                this.TippaniAttachment.ActionMode = "E";
                this.TippaniAttachment.LoadAttachmentFromDartaaChalaani(orgID, regDate, regNo);

                this.VisitTippani.LoadBodyFromDartaaChalaani(orgID, regDate, regNo);
            }
            //else if (Request.UrlReferrer != null && Path.GetFileName(Request.UrlReferrer.ToString()).ToUpper() == "MESSAGEVIEW.ASPX" && Session["tippani_from_message"] != null)
            else if (Session["tippani_from_Dartaa_chalaani"] != null)
            {
                this.lblConfirmation.Text = "यो टिप्पणी Dartaa Chalaani बाट उठाएको हो ।";
                string composite = Session["tippani_from_Dartaa_chalaani"].ToString();
                Session["tippani_from_Dartaa_chalaani"] = null;
                char[] token = { '_' };

                int    orgID   = int.Parse(composite.Split(token)[0]);
                string regDate = composite.Split(token)[1];
                int    regNo   = int.Parse(composite.Split(token)[2]);

                this.hdnDarIDs.Value = orgID.ToString() + "_" + regDate + "_" + regNo.ToString();

                this.TippaniAttachment.ActionMode = "E";
                this.TippaniAttachment.LoadAttachmentFromDartaaChalaani(orgID, regDate, regNo);

                this.VisitTippani.LoadBodyFromDartaaChalaani(orgID, regDate, regNo);
            }
            else
            {
                Session["tippani_mode"]                 = null;
                Session["tippani_from_message"]         = null;
                Session["tippani_from_Dartaa_chalaani"] = null;
            }
        }
    }
    protected void btnSaveAsDraft_Click(object sender, EventArgs e)
    {
        if (this.TippaniRequestViewer.GrdRequestViewer.SelectedIndex < 0)
        {
            this.lblStatusMessage.Text = "क्रिपया टिप्पनी छान्नुहोस।";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.TippaniRequestViewer.IsValidForSending == false)
        {
            this.lblStatusMessage.Text = "यो टिप्पणी पहिलेनै पठाइसकेको छ।<br>त्यसैले यो टिप्पणीको लागी लेख Draft गर्न सक्नुहुन्न।";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.TippaniRequestViewer.GrdRequestViewer.SelectedRow.Cells[13].Text == "3" || this.TippaniRequestViewer.GrdRequestViewer.SelectedRow.Cells[13].Text == "4")
        {
            this.lblStatusMessage.Text = "तपाईले Final approve भएको टिप्पणीमा काम गर्न सक्नुहुन्न।";
            this.programmaticModalPopup.Show();
            return;
        }

        ATTGeneralTippaniProcess updateProcess = new ATTGeneralTippaniProcess();

        if (this.hdnForm.Value == "0")
        {
            updateProcess        = this.TippaniRequestViewer.GetSelfActorProcess();
            updateProcess.Note   = this.txtNote.Text;
            updateProcess.Status = null;
        }
        else if (this.hdnForm.Value == "1")
        {
            updateProcess = null;

            this.ClearME();
            this.hdnForm.Value         = "1";
            this.lblStatusMessage.Text = "तपाईले पठाउनु भएको टिप्पणीमा तपाईले काम गर्न सक्नुहुन्न।.";
            this.programmaticModalPopup.Show();

            return;
        }

        try
        {
            if (this.hdnForm.Value == "0")
            {
                BLLGeneralTippaniProcess.UpdateChannelPersonDecisionAndAddProcess(updateProcess, null, null, this.TippaniRequestViewer.TippaniSubjectType);
                this.ClearME();

                this.TippaniRequestViewer.LoadTippaniRequest(1);

                this.lblStatusMessage.Text = "Tippani text has been saved as draft.";
                this.programmaticModalPopup.Show();
            }
            else if (this.hdnForm.Value == "1")
            {
                this.ClearME();
                this.hdnForm.Value         = "1";
                this.lblStatusMessage.Text = "तपाईले पठाउनु भएको टिप्पणीमा तपाईले काम गर्न सक्नुहुन्न।.";
                this.programmaticModalPopup.Show();
            }
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        #region Validation

        if (this.IsTippaniValidate() == false)
        {
            return;
        }

        #endregion

        ATTGeneralTippaniProcess updateProcess = new ATTGeneralTippaniProcess();
        if (this.hdnForm.Value == "0")
        {
            updateProcess        = this.TippaniRequestViewer.GetSelfActorProcess();
            updateProcess.Note   = this.txtNote.Text;
            updateProcess.Status = int.Parse(this.ddlDStatus_Rqd.SelectedValue);
        }
        else if (this.hdnForm.Value == "1")
        {
            updateProcess = null;

            this.ClearME();
            this.hdnForm.Value         = "1";
            this.lblStatusMessage.Text = "तपाईले पठाउनु भएको टिप्पणीमा तपाईले काम गर्न सक्नुहुन्न।";
            this.programmaticModalPopup.Show();

            return;
        }

        List <ATTGeneralTippaniProcess> processlst = new List <ATTGeneralTippaniProcess>();

        if (this.hdnForm.Value == "0")
        {
            processlst = this.chnlPerson.GetTippaniProcessList(updateProcess.OrgID, updateProcess.TippaniID, this.User.UserName);
        }

        List <ATTGeneralTippaniAttachment> lstAttachment = this.TippaniAttachment.GetAttachment(updateProcess.OrgID, updateProcess.TippaniID, this.User.UserName);

        try
        {
            if (this.hdnForm.Value == "0")
            {
                BLLGeneralTippaniProcess.UpdateChannelPersonDecisionAndAddProcess(updateProcess, processlst, lstAttachment, this.TippaniRequestViewer.TippaniSubjectType);
                this.ClearME();

                this.TippaniRequestViewer.LoadTippaniRequest(1);

                this.lblStatusMessage.Text = "Your decision and process has been saved successfully.";
                this.programmaticModalPopup.Show();
            }
            else if (this.hdnForm.Value == "1")
            {
                this.ClearME();
                this.hdnForm.Value         = "1";
                this.lblStatusMessage.Text = "तपाईले पठाउनु भएको टिप्पणीमा तपाईले काम गर्न सक्नुहुन्न।";
                this.programmaticModalPopup.Show();
            }
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }