예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.IsPostBack == false)
        {
            this.LoadOrganization();
            this.LoadTippaniSubject();
            this.LoadPriority();

            int    orgID            = this.User.OrgID;
            int    tippaniSubjectID = this.TippaniSubjectID;
            double empID            = this.User.PID;

            bool channelMember = BLLTippaniChannel.CheckLoginUserIsChannelMember(orgID, tippaniSubjectID, empID);

            this.txtTippaniText.ReadOnly = !channelMember;
            this.txtFileNo.ReadOnly      = !channelMember;

            if (channelMember == false)
            {
                this.lblPersonStatus.Text    = "टिप्पणी उठाउनको लागी Login User टिप्पणी च्यानलको सदस्य हुनुपर्छ।";
                this.lblPersonStatus.Visible = true;
            }
            else
            {
                this.lblPersonStatus.Text    = "";
                this.lblPersonStatus.Visible = false;
            }
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.IsPostBack == false)
     {
         string type = BLLTippaniChannel.GetLoginEmpType(this.User.OrgID, (int)this.TippaniRequestViewer.TippaniSubjectType, this.User.PID);
         this.LoadTippaniStatus(type);
     }
 }
    void LoadChannelPerson()
    {
        List <ATTTippaniChannel> lst = BLLTippaniChannel.GetTippaniChannelList(this.User.OrgID, this.TippaniSubjectID);

        lst.RemoveAll
        (
            delegate(ATTTippaniChannel c)
        {
            return(c.ChannelPersonID == this.User.PID);
        }
        );
        this.grdChannelPerson.DataSource = lst;
        this.grdChannelPerson.DataBind();
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.lstTippaniSubject.SelectedIndex < 0)
        {
            this.lblStatusMessage.Text = "Please select any Tippani Subject from list";
            this.programmaticModalPopup.Show();
            return;
        }

        ATTOrganizationTippaniSubject tippani = (ATTOrganizationTippaniSubject)Session["TempTippaniSubject"];
        List <ATTTippaniChannel>      lst     = tippani.LstTippaniChannel;

        int index = 0;

        foreach (GridViewRow row in this.grdChannelPerson.Rows)
        {
            lst[index].FromDate           = ((TextBox)row.FindControl("txtFromDate_Rdt")).Text;
            lst[index].ChannelPersonOrder = int.Parse(((DropDownList)row.FindControl("ddlOrder_Rqd")).SelectedValue);
            lst[index].ChannelPersonType  = ((DropDownList)row.FindControl("ddlType_Rqd")).SelectedValue;
            lst[index].IsFinalApprover    = ((CheckBox)row.FindControl("chkApprover")).Checked;
            lst[index].ToDate             = "";

            if (lst[index].Action != "D")
            {
                if
                (
                    lst[index].NewValue == lst[index].OldValue && lst[index].Action != "A"
                )
                {
                    lst[index].Action = "N";
                }
                else
                {
                    if (lst[index].Action == "A")
                    {
                        lst[index].Action = "A";
                    }
                    else
                    {
                        lst[index].Action = "E";
                    }
                }
            }

            index++;
        }

        try
        {
            BLLTippaniChannel.AddTippaniChannel(lst);
            lst.RemoveAll
            (
                delegate(ATTTippaniChannel c)
            {
                return(c.Action == "D");
            }
            );
            List <ATTOrganizationTippaniSubject> orgLst = (List <ATTOrganizationTippaniSubject>)Session["TippaniSubjectLst"];

            if (this.lstTippaniSubject.SelectedIndex < 0)
            {
                orgLst.Add(tippani);
            }
            else
            {
                orgLst[this.lstTippaniSubject.SelectedIndex] = tippani;
            }

            this.ClearME();

            this.lblStatusMessage.Text = "Tippani Subject Channel saved successfully.";
            this.programmaticModalPopup.Show();
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }