Exemplo n.º 1
0
        public void getAllDetails(string iDocSendID)
        {
            entDocument objEnt;
            SendRecDoc  objDoc = new SendRecDoc();
            int         userid = ((UserDetails)Session[clsConstant.TOKEN]).UserID;

            objEnt = objDoc.getDocDetailsMDB(int.Parse(id));
            lblDocCategory.Text = objEnt.DocCat;
            lblDocID.Text       = objEnt.DocID;
            lblDocType.Text     = objEnt.DocType;
            lblDueDate.Text     = objEnt.DueDate;
            lblDocName.Text     = objEnt.DocName;
            if (((UserDetails)Session[clsConstant.TOKEN]).UserID.ToString() == objEnt.UserID)
            {
                lblSenderName.Text = "ME";
            }
            else
            {
                lblSenderName.Text = objEnt.SenderName;
            }
            lblLoanNo.Text             = objEnt.LoanNo;
            lblTaNumber.Text           = objEnt.TANo;
            lblProject.Text            = objEnt.Project;
            lblFileTrackingID.Text     = objEnt.FileTrackingID;
            Session["userRemindEmail"] = objEnt.eMailID;
        }
Exemplo n.º 2
0
        public void SaveComment_clarification(string _Type, string _iDocsendDetailsID, string _sDocumentName, string refno)
        {
            SendRecDoc objDoc  = new SendRecDoc();
            string     PuserID = ((UserDetails)Session[clsConstant.TOKEN]).UserID.ToString();

            string sqlto = "select  tblUserMaster.iUserID from tblUserMaster ";

            sqlto = sqlto + " join tblDocSendDetail on tblDocSendDetail.iUserID=tblUserMaster.iUserID ";
            sqlto = sqlto + " where iDocSendID =" + _iDocsendDetailsID + " and bTOCC=1 ";

            SqlConnection  cntouser = new SqlConnection(ConfigurationManager.ConnectionStrings["TA7511DBConnString"].ConnectionString);
            SqlDataAdapter adtouser = new System.Data.SqlClient.SqlDataAdapter(sqlto, cntouser);
            DataSet        dstouser = new DataSet();

            adtouser.Fill(dstouser);
            for (int i = 0; i <= dstouser.Tables[0].Rows.Count - 1; i++)
            {
                string userto = dstouser.Tables[0].Rows[i]["iUserID"].ToString();

                string         sqlmcid = " select imcid from tblDocSend where iDocSendID=" + _iDocsendDetailsID;
                SqlConnection  mcidcon = new SqlConnection(ConfigurationManager.ConnectionStrings["TA7511DBConnString"].ConnectionString);
                SqlDataAdapter mciad   = new System.Data.SqlClient.SqlDataAdapter(sqlmcid, mcidcon);
                DataSet        dsmcid  = new DataSet();
                mciad.Fill(dsmcid);

                string emailAlert = string.Empty;

                DataSet dsuserEmail = new DataSet();
                dsuserEmail = objDoc.getmailforrejectApprove(int.Parse(dsmcid.Tables[0].Rows[0]["imcid"].ToString()));


                emailAlert += GetFromID(int.Parse(dsmcid.Tables[0].Rows[0]["imcid"].ToString())) + ';';
                emailAlert += dsuserEmail.Tables[0].Rows[0]["selectusr"].ToString() + ';';
                emailAlert  = FindEmailID(emailAlert, ((UserDetails)(Session[clsConstant.TOKEN])).EmailID) + ';';
                if (emailAlert.Contains("*****@*****.**"))
                {
                    emailAlert += "*****@*****.**" + ';';
                }
                Session["userEmail"] = emailAlert;


                if (objDoc.saveALLComment(dsmcid.Tables[0].Rows[0]["imcid"].ToString(), _iDocsendDetailsID, "R", _sDocumentName, refno, DateTime.Now, int.Parse(PuserID), userto, "") > 0)
                {
                    Utility objUtl = new Utility();
                    try
                    {
                        string nameOfSender = ((UserDetails)Session[clsConstant.TOKEN]).FirstName.ToString() + ' ' + ((UserDetails)Session[clsConstant.TOKEN]).LastName.ToString();

                        objUtl.SendAlertEmail_MC_NIC_NotAttachment(Session["userEmail"].ToString(), "Replied - " + refno, nameOfSender, null, null, ((UserDetails)Session[clsConstant.TOKEN]).Designation,
                                                                   ((UserDetails)Session[clsConstant.TOKEN]).Agency);
                    }

                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }
        }
 protected void fillComboBox(DropDownList objDdl)
 {
     objDoc                = new SendRecDoc();
     objDdl.DataSource     = objDoc.bindControl(clsConstant.SP_GET_AGENCY, "A");
     objDdl.DataTextField  = "DisplayFieldText";
     objDdl.DataValueField = "ValueFieldText";
     objDdl.DataBind();
 }
Exemplo n.º 4
0
        private void fillControl()
        {
            objDoc = new SendRecDoc();

            this.fillComboBox(ddlAgency, ddlEmailGroup);
            this.fillComboBox(ddlAgencyCC, ddlEmailGrpCC);
            this.getUserDetails(id == ""?"0":id, lstToSelectedEmail);
            this.getUserDetails(id, lstCCSelected);
        }
        protected void grdAtchFile_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                int iDocID = 0;
                for (int i = 0; i < grdAtchFile.Rows.Count; i++)
                {
                    if (grdAtchFile.SelectedIndex == i)
                    {
                        iDocID = Convert.ToInt32(grdAtchFile.DataKeys[i].Value.ToString());
                        SendRecDoc  objSendDoc = new SendRecDoc();
                        entDocument objEnt     = objSendDoc.downloadDocForAttachFile(iDocID);


                        if (objEnt != null)
                        {
                            Byte[] programFile = objEnt.FileData;


                            if (objEnt.FileName != null)
                            {
                                string contentType = objEnt.FileType;
                                //obtaing filename from the table
                                string fileName = objEnt.FileName;
                                //The ContentType property specifies the HTTP content type for the response.
                                //If no ContentType is specified, the default is text/HTML.
                                Response.ContentType = contentType;
                                //The AddHeader method adds a new HTML header and value to the response sent to the client
                                Response.AddHeader("content-disposition", "attachment;filename=" + fileName);
                                //The Charset property appends the name of the character set (for example, ISO-8859-13) to the content-type header in the Response object
                                //Here Blank is attached
                                Response.Charset = "";
                                //Provides enumerated values that are used to set the Cache-Control HTTP header.
                                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                            }

                            //Provides enumerated values that are used to set the Cache-Control HTTP header.
                            Response.BinaryWrite(programFile);
                            //The End method causes the Web server to stop
                            //  processing the script and return the current result.
                            Response.End();
                        }
                        else
                        {
                            lblMessage.Text = "File DoesNot Exists";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
        }
Exemplo n.º 6
0
        protected void btnResend_Click(object sender, EventArgs e)
        {
            SendRecDoc objDoc = new SendRecDoc();

            if (objDoc.saveComment(id, "C", int.Parse(iuserid), txtComments.Text))
            {
                lblMessage.ForeColor = System.Drawing.Color.Blue;
                lblMessage.Text      = "Document has been close successfully";
                txtComments.Text     = "";
            }
            else
            {
                lblMessage.ForeColor = System.Drawing.Color.Red;
                lblMessage.Text      = "Sorry Error Occurs";
            }
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                id      = Request.QueryString["DocDetailsId"];
                iuserid = Request.QueryString["UserID"];

                if (!IsPostBack)
                {
                    ViewState["PreviousPage"] = Request.UrlReferrer;
                    if (Utility.CheckAccess("CloseDocument") == false)
                    {
                        UrlParameterPasser urlWrapper = new UrlParameterPasser();
                        urlWrapper["pageaccesserr"] = "1";
                        urlWrapper.Url = "../DocumentLogSystem/DashBoard.aspx";
                        urlWrapper.PassParameters();
                    }
                    else
                    {
                        getAllDetails(id);
                    }
                }

                if (id == null || iuserid == null)
                {
                    UrlParameterPasser urlparam = new UrlParameterPasser("DocumentReceived1.aspx");
                    urlparam.PassParameters();
                }
                else
                {
                    objDoc = new SendRecDoc();
                    if (objDoc.isDocClose(id, iuserid))
                    {
                        lblMessage.Text     = "Document already Closed.";
                        txtComments.Visible = false;
                        btnClose.Visible    = false;
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
        }
        protected void getAgencyDetails(DropDownList objDdlst, ListBox objLstTo, ListBox objLstSelected)
        {
            objDoc = new SendRecDoc();
            objLstTo.DataSource     = objDoc.bindControl(clsConstant.SP_GET_USER_BY_AGENCY, "ListBox", int.Parse(objDdlst.SelectedValue), -1);
            objLstTo.DataTextField  = "DisplayFieldText";
            objLstTo.DataValueField = "ValueFieldText";
            objLstTo.DataBind();
            for (int iloop = 0; iloop < objLstSelected.Items.Count; iloop++)
            {
                for (int ilp = 0; ilp < objLstTo.Items.Count; ilp++)
                {
                    if (objLstTo.Items[ilp].Value == objLstSelected.Items[iloop].Value)
                    {
                        objLstTo.Items.Remove(objLstTo.Items.FindByValue(objLstTo.Items[ilp].Value));
                    }
                }
            }

            //ddlEmailGroup.SelectedIndex = -1;
        }
Exemplo n.º 9
0
        protected void btnResend_Click(object sender, EventArgs e)
        {
            try
            {
                SendRecDoc objDoc = new SendRecDoc();
                if (objDoc.saveCommentMDB(id, "M", int.Parse(iuserid), txtComments.Text))
                {
                    Utility objUtl = new Utility();

                    try
                    {
                        string nameOfSender = ((UserDetails)Session[clsConstant.TOKEN]).FirstName.ToString() + ' ' + ((UserDetails)Session[clsConstant.TOKEN]).LastName.ToString();
                        //objUtl.sendNewDocumentMail(Session["userRemindEmail"].ToString(), "Reminder - " + lblDocName.Text, nameOfSender); // for Local
                        objUtl.SendAlertEmail(Session["userRemindEmail"].ToString(), "Reminder - " + lblDocName.Text, nameOfSender
                                              , ((UserDetails)Session[clsConstant.TOKEN]).Designation.ToString(), ((UserDetails)Session[clsConstant.TOKEN]).Agency.ToString());           // for NIC
                        UrlParameterPasser objPass = new UrlParameterPasser("DashBoard.aspx");
                        Session["userMsg"] = "Reminder has been sent successfully";

                        txtComments.Text = "";
                        Session.Remove("userRemindEmail");
                        objPass.PassParameters();
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
                else
                {
                    lblMessage.ForeColor = System.Drawing.Color.Red;
                    lblMessage.Text      = "Sorry Error Occurs";
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
        }
        public void getAllDetails(string iDocSendID)
        {
            entDocument objEnt;

            SendRecDoc objDoc = new SendRecDoc();
            int        userid = ((UserDetails)Session[clsConstant.TOKEN]).UserID;
            int        iType  = 0;

            if (type == "received")
            {
                iType = 1;
            }



            objEnt = objDoc.setEntValues(int.Parse(iDocSendID), userid, iType, int.Parse(iDocDetailsID));

            lblDocCategory.Text = objEnt.DocCat;

            lblDocID.Text = objEnt.DocID;

            lblParentDocID.Text  = objEnt.ParentID != "0" ? objEnt.ParentID : "";
            lblDocType.Text      = objEnt.DocType;
            lblDueDate.Text      = objEnt.DueDate;
            lblDocName.Text      = objEnt.DocName;
            lblAgencyName.Text   = objEnt.AgencyCode;
            hdnDesignation.Value = objEnt.Designation;
            if (((UserDetails)Session[clsConstant.TOKEN]).UserID.ToString() == objEnt.UserID)
            {
                lblSenderName.Text = ((UserDetails)Session[clsConstant.TOKEN]).userNm.ToString(); // "ME";
            }
            else
            {
                lblSenderName.Text = objEnt.SenderName;
            }


            if ((objEnt.LoanNo != "" && objEnt.TANo.ToString() == "" && objEnt.Project.ToString() == "") || (objEnt.LoanNo == "" && objEnt.TANo.ToString() != "" && objEnt.Project.ToString() == "") || (objEnt.LoanNo == "" && objEnt.TANo.ToString() == "" && objEnt.Project.ToString() != "") ||
                (objEnt.LoanNo != "" && objEnt.TANo.ToString() == "" && objEnt.Project.ToString() != "") ||
                (objEnt.LoanNo == "" && objEnt.TANo.ToString() != "" && objEnt.Project.ToString() != ""))
            {
                lblLoanNo.Text      = objEnt.LoanNo;
                lblTaNumber.Text    = objEnt.TANo;
                lblProject.Text     = objEnt.Project;
                tdLoan.InnerText    = "Loan";
                tdProject.InnerText = "Project";
                tdTA.InnerText      = "TA No";
            }
            else
            {
                lblLoanNo.Text      = objEnt.Pipeline;
                lblTaNumber.Text    = objEnt.AAA;
                lblProject.Text     = objEnt.Portfolio;
                tdLoan.InnerText    = "Pipeline";
                tdProject.InnerText = "Portfolio";
                tdTA.InnerText      = "AAA No";
            }

            lblFileTrackingID.Text = objEnt.FileTrackingID;
            txtMessage.Text        = objEnt.Message.Replace("<br>", "\n");
            txtReminder.Text       = objEnt.ReminderDetails;
            txtReply.Text          = objEnt.ReplyDetails;
            lblSenderID.Text       = objEnt.UserID;
            lblDocDetailsID.Text   = objEnt.DocSendDetailsID;

            if (txtReminder.Text.Length <= 0)
            {
                txtReminder.Visible = false;
                lblReminder.Visible = false;
            }
            if (txtReply.Text.Length <= 0)
            {
                txtReply.Visible = false;
                lblReply.Visible = false;
            }


            if (objEnt.DocSendStatus == "C")
            {
                imgBtnClose.Visible    = false;
                imgBtnReminder.Visible = false;
                btnReply.Visible       = false;
            }
            hdnCreateDate.Value = objEnt.dtCreateDate;
        }
Exemplo n.º 11
0
        protected void LoadMCData()
        {
            string sql = "SELECT vsMissionClearnceName,iProjectMasterID,iLoanId,iSectorID, (case when iLoanId is not null or  iLoanId =0  then (Select vsDocCatName from tblDocCatMaster where iDocCatID = iSectorID) end) as Sector,TaID, RETAType,RETADescription,dbo.tblUserMaster.iUserID, dbo.tblUserMaster.vsFirstName + ' ' + dbo.tblUserMaster.vsLastName AS ReceiverName, (Umast.vsFirstName +' '+ Umast.vsLastName) as SenderName";

            sql = sql + ",  dbo.tblUserMaster.iAgencyID AS ReveiverAgencyId,itouser,case when SeminarDescription='' then ADBOther else SeminarDescription end SeminarDescription,ADBOther FROM  dbo.tblMC INNER JOIN ";
            sql = sql + " dbo.tblUserMaster ON dbo.tblMC.iFromUser = dbo.tblUserMaster.iUserID INNER JOIN";
            sql = sql + " dbo.tblUserMaster AS  Umast ON dbo.tblMC.iToUser = Umast.iUserID";
            sql = sql + " wHERE iMissionClearanceId=" + MCID;

            SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["TA7511DBConnString"].ConnectionString);

            cn.Close();
            cn.Open();
            SqlDataAdapter ad = new SqlDataAdapter(sql, cn);
            DataTable      dt = new DataTable();

            ad.Fill(dt);

            if (dt.Rows.Count > 0)
            {
                lblSector.Text    = dt.Rows[0]["Sector"].ToString();
                hdnSectorID.Value = dt.Rows[0]["iSectorID"].ToString();
                txtDocName.Text   = MCID + "-" + dt.Rows[0]["vsMissionClearnceName"].ToString();

                if (Request.QueryString["PgType"] != null)
                {
                    if (Request.QueryString["PgType"].ToString() == "Appoved")
                    {
                        txtReciever.Text   = dt.Rows[0]["ReceiverName"].ToString();
                        txtSenderName.Text = dt.Rows[0]["SenderName"].ToString();
                        objDoc             = new SendRecDoc();
                        this.fillComboBox(ddlAgency, ddlEmailGroup);


                        ddlAgency.SelectedValue = dt.Rows[0]["ReveiverAgencyId"].ToString();

                        ddlAgency_SelectedIndexChanged(null, null);
                        btnMulitpleForward_Click(null, null);
                    }
                }

                else
                {
                    sql = "select * from tblUserMaster where iUserID=" + dt.Rows[0]["iToUser"].ToString();
                    DataTable dt2 = new DataTable();
                    ad = new SqlDataAdapter(sql, cn);
                    ad.Fill(dt2);


                    if (dt2.Rows.Count > 0)
                    {
                        txtReciever.Text = dt2.Rows[0]["vsFirstName"].ToString() + " " + dt2.Rows[0]["vsLastName"].ToString();
                    }


                    txtSenderName.Text = (((UserDetails)Session[clsConstant.TOKEN]).FirstName).ToString() + " " + (((UserDetails)Session[clsConstant.TOKEN]).LastName).ToString();

                    txtMultiLine.Text = Message();
                }


                if (dt.Rows[0]["iLoanId"].ToString() != "0")
                {
                    sql = "select * from tblLoanMaster where iLoanID=" + dt.Rows[0]["iLoanID"].ToString();
                    ad  = new SqlDataAdapter(sql, cn);
                    DataTable dt1 = new DataTable();
                    ad.Fill(dt1);
                    lblMCFOR.Text = "Loan";
                    ddlFundType.Items.Insert(0, new ListItem("Loan", "Loan"));
                    ddlLoanOrTA.Items.Insert(0, new ListItem(dt1.Rows[0]["vsLoanNumber"].ToString() + "-" + dt1.Rows[0]["vsLoanName"].ToString(), dt.Rows[0]["iLoanID"].ToString()));
                }
                else if (dt.Rows[0]["TaID"].ToString() != "0")
                {
                    sql = "select * from tblTAMaster where iTAID=" + dt.Rows[0]["taid"].ToString();
                    ad  = new SqlDataAdapter(sql, cn);
                    DataTable dt1 = new DataTable();
                    ad.Fill(dt1);
                    lblMCFOR.Text = "TA";
                    ddlFundType.Items.Insert(0, new ListItem("TA", "TA"));
                    ddlLoanOrTA.Items.Insert(0, new ListItem(dt1.Rows[0]["iTANumber"].ToString() + "-" + dt1.Rows[0]["vsTAName"].ToString(), dt1.Rows[0]["iTAID"].ToString()));
                }
                else if (dt.Rows[0]["RETAType"].ToString() != "0")
                {
                    if (dt.Rows[0]["RETAType"].ToString() == "1")
                    {
                        lblMCFOR.Text = "Reta";
                    }
                    if (dt.Rows[0]["RETAType"].ToString() == "2")
                    {
                        lblMCFOR.Text = "Rdta";
                    }
                    ddlFundType.Items.Insert(0, new ListItem(lblMCFOR.Text, dt.Rows[0]["RETAType"].ToString()));//pramod
                    lblMCFOR.Text          = "Reta";
                    ddlLoanOrTA.Visible    = false;
                    lblDescription.Visible = true;
                    lblDescription.Text    = dt.Rows[0]["RETADescription"].ToString();
                }
                else if (dt.Rows[0]["iProjectMasterID"].ToString() != "0")
                {
                    lblMCFOR.Text = "Project";
                    sql           = "select * from tblProjectMaster where iProjectMasterID=" + dt.Rows[0]["iProjectMasterID"].ToString();
                    ad            = new SqlDataAdapter(sql, cn);
                    DataTable dt1 = new DataTable();
                    ad.Fill(dt1);
                    lblMCFOR.Text = "Project";
                    ddlFundType.Items.Insert(0, new ListItem("Project", "Project"));
                    ddlLoanOrTA.Items.Insert(0, new ListItem(dt1.Rows[0][2].ToString() + "-" + dt1.Rows[0][1].ToString(), dt1.Rows[0][0].ToString()));
                }
                else if (dt.Rows[0]["ADBOther"].ToString() != "")
                {
                    lblMCFOR.Text = "Others";
                    ddlFundType.Items.Insert(0, new ListItem("Others", "0"));
                    ddlLoanOrTA.Visible    = false;
                    lblDescription.Visible = true;
                    lblDescription.Text    = dt.Rows[0]["ADBOther"].ToString();
                }
                else
                {
                    lblMCFOR.Text = "Seminar";
                    ddlFundType.Items.Insert(0, new ListItem("Seminar", "0"));
                    ddlLoanOrTA.Visible    = false;
                    lblDescription.Visible = true;
                    lblDescription.Text    = dt.Rows[0]["SeminarDescription"].ToString();
                }
            }
            GetMCAttatchment(MCID);
            cn.Close();
        }