protected void btnCC_Click(object sender, EventArgs e) { BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); txtSelectedIDsCC.Text = ""; string CC = ""; foreach (ListItem li in lstUsers.Items) { if (li.Selected) { DataTable dt = objUser.Get_UserDetails(int.Parse(li.Value)); if (dt.Rows.Count > 0) { if (CC.Length > 0 && dt.Rows[0]["MailID"].ToString() != "") { CC += ";"; } CC += dt.Rows[0]["MailID"].ToString(); } } } txtMailCC.Text += ";" + CC; objUser = null; //if (IsPostBack) //{ // ucEmailAttachment1.Register_JS_Attach(); //} UpdatePanel2.Update(); }
//protected void txtTo_TextChanged(object sender, EventArgs e) //{ // ucEmailAttachment1.Register_JS_Attach(); // try // { // string[] sNames = txtTo.Text.Split(';'); // if (txtTo.Text.IndexOf(',') > 0) // { // sNames = txtTo.Text.Split(','); // } // for (var i = 0; i < sNames.Length; i++) // { // if (sNames[i].IndexOf("@unimarships.com") < 0) // { // string[] ADUser = objAD.getActiveUserDetails(sNames[i]); // if (ADUser[3] != "") // { // txtTo.Text = txtTo.Text.ToLower().Replace(ADUser[1].ToString().ToLower(), ADUser[3].ToString().ToLower()); // } // } // } // } // catch { } //} //protected void txtCC_TextChanged(object sender, EventArgs e) //{ // ucEmailAttachment1.Register_JS_Attach(); // try // { // string[] sNames = txtCC.Text.Split(','); // for (var i = 0; i < sNames.Length; i++) // { // if (sNames[i].IndexOf("@unimarships.com") < 0) // { // string[] ADUser = objAD.getActiveUserDetails(sNames[i]); // if (ADUser[3] != "") // { // txtCC.Text = txtCC.Text.ToLower().Replace(ADUser[1].ToString().ToLower(), ADUser[3].ToString().ToLower()); // } // } // } // } // catch { } //} protected void btnAddTo_Click(object sender, EventArgs e) { BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); txtSelectedIDsTo.Text = ""; string To = ""; foreach (ListItem li in lstUsers.Items) { if (li.Selected) { DataTable dt = objUser.Get_UserDetails(int.Parse(li.Value)); if (dt.Rows.Count > 0) { if (To.Length > 0 && dt.Rows[0]["MailID"].ToString() != "") { To += ";"; } To += dt.Rows[0]["MailID"].ToString(); } } } txtTo.Text += ";" + To; if (IsPostBack) { ucEmailAttachment1.Register_JS_Attach(); } UpdatePanel1.Update(); objUser = null; }
protected void btnCC_Click(object sender, EventArgs e) { BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); txtSelectedIDsCC.Text = ""; string CC = ""; foreach (ListItem li in lstUsers.Items) { if (li.Selected) { DataTable dt = objUser.Get_UserDetails(int.Parse(li.Value)); if (dt.Rows.Count > 0) { if (CC.Length > 0 && dt.Rows[0]["MailID"].ToString() != "") { CC += ";"; } CC += dt.Rows[0]["MailID"].ToString(); } } } txtSelectedIDsCC.Text = CC; objUser = null; }
protected void btnAddTo_Click(object sender, EventArgs e) { BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); txtSelectedIDsTo.Text = ""; string To = ""; foreach (ListItem li in lstUsers.Items) { if (li.Selected) { DataTable dt = objUser.Get_UserDetails(int.Parse(li.Value)); if (dt.Rows.Count > 0) { if (To.Length > 0 && dt.Rows[0]["MailID"].ToString() != "") { To += ";"; } To += dt.Rows[0]["MailID"].ToString(); } } } txtMailTo.Text += ";" + To; //if (IsPostBack) //{ // ucEmailAttachment1.Register_JS_Attach(); //} // UpdatePanel2.Update(); objUser = null; string js = "showPopup('ThresholdActionSettingDew');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "Update", js, true); }
public void Get_UserDetails() { BLL_Infra_UserCredentials ojbInfra = new BLL_Infra_UserCredentials(); DataTable dtuser = ojbInfra.Get_UserDetails(Convert.ToInt32(Session["userid"].ToString())); ViewState["DeptID"] = dtuser.Rows[0]["Dep_Code"].ToString(); ViewState["USERTYPE"] = dtuser.Rows[0]["User_Type"].ToString(); }
public void Get_UserDetails() { BLL_Infra_UserCredentials ojbInfra = new BLL_Infra_UserCredentials(); DataTable dtuser = new DataTable(); if (Request.QueryString["UserID"] != null) { dtuser = ojbInfra.Get_UserDetails(Convert.ToInt32(Request.QueryString["UserID"].ToString())); } else { dtuser = ojbInfra.Get_UserDetails(Convert.ToInt32(Session["userid"].ToString())); } ViewState["DeptID"] = dtuser.Rows[0]["Dep_Code"].ToString(); }
protected void btnSendForApproval_Click(object s, EventArgs e) { BLL_TRV_QuoteRequest QR = new BLL_TRV_QuoteRequest(); BLL_TRV_TravelRequest TRequest = new BLL_TRV_TravelRequest(); BLL_Infra_UserCredentials objuser = new BLL_Infra_UserCredentials(); DataTable dtuser = objuser.Get_UserDetails(Int32.Parse(lstUserList.SelectedValue)); DataTable dtCurrentuser = objuser.Get_UserDetails(Convert.ToInt32(Session["userid"])); QR.Insert_Approval_Entry(Convert.ToInt32(Session["USERID"].ToString()), Int32.Parse(lstUserList.SelectedValue), 0, Convert.ToInt32(Request.QueryString["requestid"].ToString()), txtRemark.Text, ""); string msgmodal = String.Format("alert('Sent successfully to selected approver.');window.close();window.opener.location.reload();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Apprmodal", msgmodal, true); }
protected void SendEmailToApprovar(int fbmid, int requesterid, int approvarid) { int crewfbmidout = 0; BLL_Infra_UserCredentials ojbInfra = new BLL_Infra_UserCredentials(); DataTable dtapprovalDetails = ojbInfra.Get_UserDetails(approvarid); DataTable dtRequesterDetails = ojbInfra.Get_UserDetails(requesterid); DataSet ds = BLL_FBM_Report.FBMReportList(Convert.ToInt32(fbmid)); StringBuilder sbEmailbody = new StringBuilder(); string subject = "Pending for Approval - FBM Number :" + ds.Tables[0].Rows[0]["FBM_NUMBER"].ToString(); string path = System.Configuration.ConfigurationManager.AppSettings["APP_URL"].ToString() + "/QMS/FBM/FBM_Main_Report_Details.aspx?FBMREQUESTID=" + ds.Tables[0].Rows[0]["ID"].ToString() + "&APPROVARID=" + approvarid + "&REQUESTERID=" + requesterid; sbEmailbody.Append("Dear "); sbEmailbody.Append(dtapprovalDetails.Rows[0]["First_Name"].ToString() + ","); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("FBM Number :" + ds.Tables[0].Rows[0]["FBM_NUMBER"].ToString() + " is Pending for your Approval, Click on below link to approve it."); sbEmailbody.Append("<a href=" + path + ">" + path + "</a>"); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("Best Regards,"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtRequesterDetails.Rows[0]["User_name"].ToString().ToUpper() + " " + dtRequesterDetails.Rows[0]["Last_Name"].ToString().ToUpper()); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtRequesterDetails.Rows[0]["Designation"].ToString()); sbEmailbody.AppendLine(Convert.ToString(Session["Company_Address_GL"])); sbEmailbody.AppendLine("<br>"); int val = BLL_FBM_Report.FBMCrewMailSave(Convert.ToInt32(Session["userid"].ToString()), subject, dtapprovalDetails.Rows[0]["MailID"].ToString(), "", sbEmailbody.ToString(), ref crewfbmidout); }
protected void SendEmailForRework(int fbmid, int requesterid, int approverid) { int crewfbmidout = 0; BLL_Infra_UserCredentials ojbInfra = new BLL_Infra_UserCredentials(); DataTable dtRequesterDetails = ojbInfra.Get_UserDetails(requesterid); DataTable dtapprovalDetails = ojbInfra.Get_UserDetails(approverid); DataSet ds = BLL_FBM_Report.FBMReportList(Convert.ToInt32(fbmid)); StringBuilder sbEmailbody = new StringBuilder(); string subject = "Rework - FBM Number :" + ds.Tables[0].Rows[0]["FBM_NUMBER"].ToString(); sbEmailbody.Append("Dear "); sbEmailbody.Append(dtRequesterDetails.Rows[0]["First_Name"].ToString() + ","); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("The FBM Number :" + ds.Tables[0].Rows[0]["FBM_NUMBER"].ToString() + " is sending for Rework."); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("Best Regards,"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtapprovalDetails.Rows[0]["User_name"].ToString().ToUpper() + " " + dtapprovalDetails.Rows[0]["Last_Name"].ToString().ToUpper()); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtapprovalDetails.Rows[0]["Designation"].ToString()); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(Convert.ToString(Session["Company_Address_GL"])); sbEmailbody.AppendLine("<br>"); int val = BLL_FBM_Report.FBMCrewMailSave(Convert.ToInt32(Session["userid"].ToString()), subject, dtRequesterDetails.Rows[0]["MailID"].ToString(), "", sbEmailbody.ToString(), ref crewfbmidout); }
/// <summary> /// JIT-11845 /// Add vessel owner name and vessel owner address as per JIT /// Change signature of email template (Add Company Name) /// </summary> /// <param name="dsEmailInfo"></param> /// <param name="sEmailAddress"></param> /// <param name="strSubject"></param> /// <param name="strBody"></param> /// <param name="IsPendingApprovalPO"></param> /// <param name="OrderCode"></param> protected void FormateEmail(DataSet dsEmailInfo, out string sEmailAddress, out string strSubject, out string strBody, bool IsPendingApprovalPO, string OrderCode) { BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); DataTable dtUser = objUser.Get_UserDetails(Convert.ToInt32(Session["USERID"])); string ServerIPAdd = ConfigurationManager.AppSettings["WebQuotSite"].ToString(); strBody = @"Dear " + dsEmailInfo.Tables[0].DefaultView[0]["SHORT_NAME"].ToString() + @"<br><br> We are pleased to attach our Purchase Order for delivery of the goods quoted per your Supplier reference:" + dsEmailInfo.Tables[0].DefaultView[0]["Supplier_Quotation_Reference"].ToString() + @" for M.V.:" + dsEmailInfo.Tables[0].DefaultView[0]["Vessel_Name"].ToString() + @".<br><br> The purchase order can be downloaded from the following link <br> <a href='" + ServerIPAdd.Trim() + "'>" + ServerIPAdd.Trim() + @"</a> <br> User Name : " + dsEmailInfo.Tables[0].Rows[0]["User_name"].ToString() + @"<br> Password : " + dsEmailInfo.Tables[0].Rows[0]["Password"].ToString() + @" <br><br> <span style='color:Red'> “ANNOUNCEMENT OF NEW POLICY” </span><br> With effect from 12th Feb 2013, It is mandate to obtain only Master/ Chief Engineer’s signature and vessel stamp on any “DELIVERY NOTE” for orders delivered on board. <br> Stores Suppliers - delivering to third party/forwarder must obtain the vessel signed Delivery Note from the c/o parties.<br> Supplier confirms that " + Session["Company_Name_GL"] + @" will not pay for any delivers that are not confirmed in accordance with the above condition. <br><br/> <b> KINDLY ACKNOWLEDGE OUR PO WITH DELIVERY DAYS / READINESS DATE VIA THE ABOVE LINK WITHIN SAME WORKING DAY.</b><br><br> Please ensure accurate and complete delivery of this order to the agent, Forwarder or vessel. <br><br> If there are partial deliveries, the sender of the Purchase Order we must be informed immediately via email. <br><br> Following packing and documentation procedures to adhere strictly; <br> 1 To pack in airworthy packing (strictly in carton box) <br> 2. Markings ON ALL PACKAGES: Address to vessel name :" + dsEmailInfo.Tables[0].DefaultView[0]["Vessel_Name"].ToString() + @" and our purchase order number:" + dsEmailInfo.Tables[0].DefaultView[0]["ORDER_CODE"].ToString() + @" and vessel department____________ (eg. Engine Stores, Cabin Stores, Electrical stores, etc)<br> 3. Pls indicate the dim (LXBXH in CM), cargo weight, no.of pieces, value of goods on the manifest invoice and packing list or delivery note 4 . Kindly enclose 02 copies of delivery note into the carton/crate for ship's checking <br> 5. Original Invoice and Original Delivery Note (with original company stamp and " + Session["Company_Name_GL"] + @" of receiving staff of our forwarder) to be send to " + Session["Company_Name_GL"] + @" by email in PDF format.<br><br> Any inaccuracies, missing or damaged items will result in a delayed payment <br> of your invoice. The PO number must be indicated in the invoice for <br> prompt processing and payment. <br><br> IMPORTANT REMARK: All invoices must be issued as follows:<br> M/V..<br> " + dsEmailInfo.Tables[0].Rows[0]["Owner_Name"].ToString() + @"<br> " + dsEmailInfo.Tables[0].Rows[0]["Owner_Address"].ToString().Replace("\n", "<br>") + @"<br><br> Thank you for your co-operation.<br><br> " + Session["Company_Name_GL"].ToString() + @"<br> PURCHASING DEPARTMENT <br><br> "; strSubject = "Purchase Order No. " + OrderCode + " from " + Session["Company_Name_GL"] + " for M.V.:" + dsEmailInfo.Tables[0].DefaultView[0]["Vessel_Name"].ToString() + " , Date :" + DateTime.Now.ToString(); sEmailAddress = dsEmailInfo.Tables[0].DefaultView[0]["SuppEmailIDs"].ToString(); }
protected void btnRqstUptResponse_Click(object sender, EventArgs e) { BLL_Crew_CrewDetails objBLLCrew = new BLL_Crew_CrewDetails(); BLL_Infra_UserCredentials ojbInfra = new BLL_Infra_UserCredentials(); string sToEmailAddress = "", strEmailAddCc = "", strFormatSubject = "Update response"; DataTable dtEmailAdd = BLL_SCM_Report.SCMReportGetEmailAddToSendMailForResponse(Convert.ToInt32(ddlYear.SelectedValue), Convert.ToInt32(ddlMonth.SelectedValue)); foreach (DataRow dr in dtEmailAdd.Rows) { sToEmailAddress += dr["EMAIL_ADD"].ToString() + ";"; } if (dtEmailAdd.Rows.Count > 0) { DataTable dtRequesterDetails = ojbInfra.Get_UserDetails(Convert.ToInt32(Session["userid"].ToString())); StringBuilder sbEmailbody = new StringBuilder(); string path = System.Configuration.ConfigurationManager.AppSettings["APP_URL"].ToString() + "/QMS/SCM/SCM_Response.aspx"; //string path = "http://seachange.dyndns.info/smslog/QMS/SCM/SCM_Response.aspx"; sbEmailbody.Append("Dear All,"); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("Please click on below link to update the response."); sbEmailbody.Append("<a href=" + path + ">" + path + "</a>"); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("Best Regards,"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtRequesterDetails.Rows[0]["User_name"].ToString().ToUpper() + " " + dtRequesterDetails.Rows[0]["Last_Name"].ToString().ToUpper()); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtRequesterDetails.Rows[0]["Designation"].ToString()); sbEmailbody.AppendLine(Convert.ToString(Session["Company_Address_GL"])); sbEmailbody.AppendLine("<br>"); int MailID = objBLLCrew.Send_CrewNotification(0, 0, 0, 0, sToEmailAddress, strEmailAddCc, "", strFormatSubject, sbEmailbody.ToString(), "", "MAIL", "", UDFLib.ConvertToInteger(Session["USERID"].ToString()), "DRAFT"); string URL = String.Format("window.open('/" + System.Configuration.ConfigurationManager.AppSettings["APP_NAME"].ToString() + "/crew/EmailEditor.aspx?ID=+" + MailID.ToString() + "');"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "k" + MailID.ToString(), URL, true); } }
//protected DataTable GetAllADDomainUsers_dl() //{ // string domainpath = "192.168.0.100"; // DirectoryEntry searchRoot = new DirectoryEntry("LDAP://" + domainpath); // DirectorySearcher search = new DirectorySearcher(searchRoot); // search.Filter = "(&(objectClass=user)(objectCategory=person)(!userAccountControl:1.2.840.113556.1.4.803:=2))"; // search.PropertiesToLoad.Add("samaccountname"); // search.PropertiesToLoad.Add("givenname"); // search.PropertiesToLoad.Add("sn"); // DataTable dt = new DataTable(); // dt.Columns.Add(new DataColumn("UserId", typeof(string))); // dt.Columns.Add(new DataColumn("UserName", typeof(string))); // SearchResult result; // SearchResultCollection resultCol = search.FindAll(); // if (resultCol != null) // { // for (int counter = 0; counter < resultCol.Count; counter++) // { // result = resultCol[counter]; // if (result.Properties.Contains("samaccountname")) // { // if (result.Properties.Contains("userAccountControl")) // { // int val = (int)result.Properties["userAccountControl"][0]; // } // DataRow dr = dt.NewRow(); // dr.BeginEdit(); // dr["UserId"] = ((String)result.Properties["samaccountname"][0]); // string FirstName = ""; // String LastName = ""; // if (result.Properties.Contains("givenname")) // { // FirstName = ((String)result.Properties["givenname"][0]); // } // if (result.Properties.Contains("sn")) // { // LastName = ((String)result.Properties["sn"][0]); // } // dr["UserName"] = FirstName + " " + LastName; // dr.EndEdit(); // if (FirstName != "" && LastName != "") // { // dt.Rows.Add(dr); // } // } // } // } // dt.DefaultView.Sort = "UserName"; // return dt; //}//function retrive the all the User information //protected string[] getActiveUserDetails(string UserName) //{ // string filter = string.Format("(&(ObjectClass={0})(sAMAccountName={1}))", "person", UserName); // string domain = "192.168.0.100"; // string[] properties = new string[] { "fullname" }; // string displayName = ""; // string firstName = ""; // string lastName = ""; // string email = ""; // string jobtitle = ""; // string department = ""; // try // { // DirectoryEntry adRoot = new DirectoryEntry("LDAP://" + domain, null, null, AuthenticationTypes.Secure); // DirectorySearcher searcher = new DirectorySearcher(adRoot); searcher.SearchScope = SearchScope.Subtree; // searcher.ReferralChasing = ReferralChasingOption.All; // searcher.PropertiesToLoad.AddRange(properties); // searcher.Filter = filter; // SearchResult result = searcher.FindOne(); // DirectoryEntry directoryEntry = result.GetDirectoryEntry(); // if (directoryEntry.Properties.Contains("displayName")) // displayName = directoryEntry.Properties["displayName"][0].ToString(); // if (directoryEntry.Properties.Contains("givenName")) // firstName = directoryEntry.Properties["givenName"][0].ToString(); // if (directoryEntry.Properties.Contains("sn")) // lastName = directoryEntry.Properties["sn"][0].ToString(); // if (directoryEntry.Properties.Contains("mail")) // email = directoryEntry.Properties["mail"][0].ToString(); // if (directoryEntry.Properties.Contains("title")) // jobtitle = directoryEntry.Properties["title"][0].ToString(); // if (directoryEntry.Properties.Contains("department")) // jobtitle = directoryEntry.Properties["department"][0].ToString(); // } // catch // { // } // return new string[] { displayName, firstName, lastName, email, jobtitle, department }; //} protected void txtUserName_TextChanged(object sender, EventArgs e) { if (txtUserName.Text != "") { BLL_Infra_UserCredentials objuserBLL = new BLL_Infra_UserCredentials(); DataTable dt = objuserBLL.Get_UserDetails(txtUserName.Text); if (dt.Rows.Count > 0) { lblMessage.Text = "UserName already exists!!"; } else { pnlUserDetails.Visible = true; lblMessage.Text = ""; txtUserName.Enabled = false; } //ddlNetwkid.SelectedIndex = 0; } }
protected void FormateEmail(DataSet dsEmailInfo, out string sEmailAddress, out string strSubject, out string strBody, bool IsPendingApprovalPO, string OrderCode) { BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); DataTable dtUser = objUser.Get_UserDetails(Convert.ToInt32(Session["USERID"])); string ServerIPAdd = ConfigurationManager.AppSettings["WebQuotSite"].ToString(); strBody = @"Dear " + dsEmailInfo.Tables[0].DefaultView[0]["SHORT_NAME"].ToString() + @"<br><br> We are pleased to attach our Purchase Order for delivery of the goods quoted per your quotation number:" + dsEmailInfo.Tables[0].DefaultView[0]["Supplier_Quotation_Reference"].ToString() + @" for M.V.:" + dsEmailInfo.Tables[0].DefaultView[0]["Vessel_Name"].ToString() + @".<br><br> The purchase order can be downloaded from the following link <br> <b> KINDLY ACKNOWLEDGE OUR PO WITH DELIVERY DAYS / READINESS DATE VIA THE ABOVE LINK WITHIN SAME WORKING DAY.</b><br><br> Please ensure accurate and complete delivery of this order to the agent, Forwarder or vessel. <br><br> If there are partial deliveries, the sender of the Purchase Order we must be informed immediately via email. <br><br> Following packing and documentation procedures to adhere strictly; <br> 1 To pack in airworthy packing (strictly in carton box) <br> 2. Markings ON ALL PACKAGES: Address to vessel name :" + dsEmailInfo.Tables[0].DefaultView[0]["Vessel_Name"].ToString() + @" and our purchase order number:" + dsEmailInfo.Tables[0].DefaultView[0]["ORDER_CODE"].ToString() + @" and vessel department____________ (eg. Engine Stores, Cabin Stores, Electrical stores, etc)<br> 3. Pls indicate the dim (LXBXH in CM), cargo weight, no.of pieces, value of goods on the manifest invoice and packing list or delivery note 4 . Kindly enclose 02 copies of delivery note into the carton/crate for ship's checking <br> 5. Original Invoice and Original Delivery Note (with original company stamp and signature of receiving staff of our forwarder) to be send to " + Session["Company_Name_GL"] + @" by email in PDF format.<br><br> Any inaccuracies, missing or damaged items will result in a delayed payment <br> of your invoice. The PO number must be indicated in the invoice for <br> prompt processing and payment. <br><br> Thank you & best regards,<br> " + Session["USERFULLNAME"].ToString() + @"<br> " + dtUser.Rows[0]["Designation"].ToString() + @"<br> " + Convert.ToString(Session["Company_Address_GL"]) + @" Mobile:+65 " + dtUser.Rows[0]["Mobile_Number"].ToString() + @"<br> Email: " + dtUser.Rows[0]["MailID"].ToString() + @"<br> <br><br> "; strSubject = "Purchase Order No. " + OrderCode + " from " + Session["Company_Name_GL"] + " for M.V.:" + dsEmailInfo.Tables[0].DefaultView[0]["Vessel_Name"].ToString() + " , Date :" + DateTime.Now.ToString(); sEmailAddress = dsEmailInfo.Tables[0].DefaultView[0]["SuppEmailIDs"].ToString(); }
protected void HighLight_MandatoryQ() { int CurrentUserID = GetSessionUserID(); BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); DataTable dt = objUser.Get_UserDetails(CurrentUserID); if (dt.Rows.Count > 0) { rdo2.CssClass = "highlight"; rdo3.CssClass = "highlight"; if (dt.Rows[0]["Dep_Code"].ToString() == "5")//Technical { rdo7.CssClass = "highlight"; rdo10.CssClass = "highlight"; rdo11.CssClass = "highlight"; rdo12.CssClass = "highlight"; } else if (dt.Rows[0]["Dep_Code"].ToString() == "4")//Operations { rdo4.CssClass = "highlight"; rdo5.CssClass = "highlight"; rdo6.CssClass = "highlight"; rdo8.CssClass = "highlight"; rdo9.CssClass = "highlight"; rdo12.CssClass = "highlight"; } else if (dt.Rows[0]["Dep_Code"].ToString() == "9")//Chartering { rdo8.CssClass = "highlight"; rdo9.CssClass = "highlight"; } else if (dt.Rows[0]["Dep_Code"].ToString() == "7")//SQA { rdo4.CssClass = "highlight"; rdo5.CssClass = "highlight"; } } }
protected void onUpdate(object source, CommandEventArgs e) { OperationMode = "Edit User"; DataTable dt = objUserBLL.Get_UserDetails(Convert.ToInt32(e.CommandArgument.ToString())); ddlUserType.SelectedValue = dt.Rows[0]["User_type"].ToString() != "" ? dt.Rows[0]["User_type"].ToString() : "0"; if ((ddlCompany.Items.FindByValue(dt.Rows[0]["CompanyID"].ToString()) != null)) { ddlCompany.SelectedValue = dt.Rows[0]["CompanyID"].ToString() != "" ? dt.Rows[0]["CompanyID"].ToString() : "0"; } else { ddlCompany.SelectedValue = "0"; } if (ddlCompany.SelectedValue != "0") { Load_DepartmentList(); Load_FleetList(); Load_ManagerList(); } txtUserID.Text = dt.Rows[0]["UserID"].ToString(); txtFirstName.Text = dt.Rows[0]["First_Name"].ToString(); txtLastName.Text = dt.Rows[0]["Last_Name"].ToString(); txtDateOfBirth.Text = dt.Rows[0]["DOB"].ToString(); txtDesignation.Text = dt.Rows[0]["Designation"].ToString(); txtPermanentAddress.Text = dt.Rows[0]["Permanent_Address"].ToString(); txtPresentAddress.Text = dt.Rows[0]["Present_Address"].ToString(); txtApprovalLimit.Text = dt.Rows[0]["Approval_Limit"].ToString(); txtDateOfJoining.Text = dt.Rows[0]["Date_Of_Joining"].ToString(); txtDateOfProbation.Text = dt.Rows[0]["Date_Of_Probation"].ToString(); txtEMail.Text = dt.Rows[0]["MailID"].ToString(); txtMobileNo.Text = dt.Rows[0]["Mobile_Number"].ToString(); if (ddlUserType.Items.FindByValue(dt.Rows[0]["User_Type"].ToString()) != null) { ddlUserType.SelectedValue = dt.Rows[0]["User_Type"].ToString() != "" ? dt.Rows[0]["User_Type"].ToString() : "0"; } if (ddlDepartment.Items.FindByValue(dt.Rows[0]["Dep_Code"].ToString()) != null) { ddlDepartment.SelectedValue = dt.Rows[0]["Dep_Code"].ToString() != "" ? dt.Rows[0]["Dep_Code"].ToString() : "0"; } if (ddlFleet.Items.FindByValue(dt.Rows[0]["Tech_Manager"].ToString()) != null) { ddlFleet.SelectedValue = dt.Rows[0]["Tech_Manager"].ToString() != "" ? dt.Rows[0]["Tech_Manager"].ToString() : "0"; } if (ddlManager.Items.FindByValue(dt.Rows[0]["ManagerID"].ToString()) != null) { ddlManager.SelectedValue = dt.Rows[0]["ManagerID"].ToString() != "" ? dt.Rows[0]["ManagerID"].ToString() : "0"; } if (ddlNationality.Items.FindByValue(dt.Rows[0]["NationalityID"].ToString()) != null) { ddlNationality.SelectedValue = dt.Rows[0]["NationalityID"].ToString() != "" ? dt.Rows[0]["NationalityID"].ToString() : "0"; } else { ddlNationality.SelectedValue = "0"; } //ddlNetwkid.SelectedValue = dt.Rows[0]["NetWkId"].ToString() != "" ? dt.Rows[0]["NetWkId"].ToString() : "0"; iUserCompanyID = Convert.ToInt32(ddlCompany.SelectedValue); string Usermodal = String.Format("showModal('divadd',false);"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Usermodal", Usermodal, true); }
protected void BtnSendEmail_Click(object sender, EventArgs e) { try { int rowcount = ucCustomPagerItems.isCountRecord; DataSet ds = objJobStatus.TecJobDoneNotDoneSummarySearch(UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue), UDFLib.ConvertIntegerToNull(DDLVessel.SelectedValue), null, null, null, null, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount); ExcelDataPMSJob objExpJob = new ExcelDataPMSJob(); StringBuilder sbEmailbody = new StringBuilder(); string Attachfilename = ""; string CaptainName = "", ChiefEnggName = ""; objExpJob.WriteExcell(ds, ref Attachfilename); string sToEmailAddress = ds.Tables[2].Rows[0]["Vessel_email"].ToString(), strEmailAddCc = ds.Tables[2].Rows[0]["Fleet_email"].ToString() + ";" + ds.Tables[2].Rows[0]["Fleet_Suprintendent"].ToString(), strFormatSubject = "PMS Jobs updating status"; DataTable dtRequesterDetails = ojbInfra.Get_UserDetails(Convert.ToInt32(Session["userid"].ToString())); if (ds.Tables[1].Rows.Count > 0) { CaptainName = ds.Tables[1].Rows[0]["Staff_Name"].ToString(); } else { CaptainName = ""; } if (ds.Tables[3].Rows.Count > 0) { ChiefEnggName = ds.Tables[3].Rows[0]["Staff_Name"].ToString(); } else { ChiefEnggName = ""; } sbEmailbody.Append("Dear Capt. " + CaptainName + " & C/E " + ChiefEnggName + ","); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("Best Regards,"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtRequesterDetails.Rows[0]["User_name"].ToString().ToUpper() + " " + dtRequesterDetails.Rows[0]["Last_Name"].ToString().ToUpper()); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtRequesterDetails.Rows[0]["Designation"].ToString()); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(Convert.ToString(Session["Company_Address_GL"])); sbEmailbody.AppendLine("<br>"); /* Make Entry for email nofification */ int MailID = objBLLCrew.Send_CrewNotification(0, 0, 0, 0, sToEmailAddress, strEmailAddCc, "", strFormatSubject, sbEmailbody.ToString(), "", "MAIL", "", UDFLib.ConvertToInteger(Session["USERID"].ToString()), "DRAFT"); //string uploadpath = @"\\server01\uploads\PmsJobs"; //string uploadpath = @"\\" + System.Configuration.ConfigurationManager.AppSettings["APP_NAME"].ToString() + "" + @"\uploads\PmsJobs"; string uploadpath = @"uploads\PmsJobs"; /* Make Entry for email attachment */ BLL_Infra_Common.Insert_EmailAttachedFile(MailID, Attachfilename, uploadpath + @"\" + Attachfilename); string URL = String.Format("window.open('/" + System.Configuration.ConfigurationManager.AppSettings["APP_NAME"].ToString() + "/crew/EmailEditor.aspx?ID=+" + MailID.ToString() + "');"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "k" + MailID.ToString(), URL, true); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); string js = "alert('" + UDFLib.GetException("SystemError/ GeneralMessage") + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true); } }
protected void SendPurchaseOrder() { // string[] Attchment = new string[10]; lblError.Text = ""; string strPath = Server.MapPath(".") + "\\SendPO\\"; DataSet DsPO = new DataSet(); DataSet dsSendMailInfo = new DataSet(); BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); DataTable dtUser = objUser.Get_UserDetails(Convert.ToInt32(Session["USERID"])); string emailIDcc = dtUser.Rows[0]["MailID"].ToString(); bool IsPO = false; if (rgdSuppliers.MasterTableView.Items.Count > 0) { foreach (GridDataItem dataItem in rgdSuppliers.MasterTableView.Items) { CheckBox chk = (CheckBox)(dataItem.FindControl("chkSendOrder") as CheckBox); if ((chk.Checked)) { IsPO = true; } } } if (rgdSuppliers.MasterTableView.Items.Count > 0) { int i = 0; if (IsPO) { DataTable dtQuotationList = new DataTable(); dtQuotationList.Columns.Add("Qtncode"); dtQuotationList.Columns.Add("amount"); string sDlvIns = txtdlvins.Text != "" ? txtdlvins.Text : DBNull.Value.ToString(); string strDeliveryPort = DDLPort.SelectedItem.ToString() != "--Select--" ? DDLPort.SelectedValue.ToString() : DBNull.Value.ToString(); string sEta = txteta.Text != "" ? txteta.Text + " " + txtETAAPPM.Text.ToString().Trim() + ":00" : Convert.ToString("01/01/1900"); string sRemark = txtremark.Text != "" ? txtremark.Text : DBNull.Value.ToString(); string sAgent = txtagent.Text != "" ? txtagent.Text : DBNull.Value.ToString(); string sEtd = txtetd.Text != "" ? txtetd.Text + " " + txtETDAMPM.Text.ToString().Trim() + ":00" : Convert.ToString("01/01/1900"); foreach (GridDataItem dataItem in rgdSuppliers.MasterTableView.Items) { CheckBox chk = (CheckBox)(dataItem.FindControl("chkSendOrder") as CheckBox); string chkAppStatus = dataItem["APPROVED_Status"].Text; if ((chk.Checked) && dataItem["APPROVED_Status"].Text == "YES") { i++; using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase()) { DataRow drQTN = dtQuotationList.NewRow(); drQTN["Qtncode"] = dataItem["QUOTATION_CODE"].Text.ToString(); drQTN["amount"] = "0"; dtQuotationList.Rows.Add(drQTN); string OrderCode = dataItem["ORDER_CODE"].Text; int sts = objTechService.PMSUpdOtherPODetails(sDlvIns, strDeliveryPort, sEta, sRemark, sEtd, sAgent, Request.QueryString["Document_Code"].ToString(), Request.QueryString["Requisitioncode"].ToString(), Convert.ToInt32(Request.QueryString["Vessel_Code"].ToString()), dataItem["QUOTATION_CODE"].Text.ToString(), dataItem["SUPPLIER"].Text.ToString(), Convert.ToInt32(Session["USERID"].ToString())); DsPO = objTechService.GetDataToGeneratPO(Request.QueryString["Requisitioncode"].ToString(), Request.QueryString["Vessel_Code"].ToString(), dataItem["SUPPLIER"].Text.ToString(), dataItem["QUOTATION_CODE"].Text, Request.QueryString["Document_Code"].ToString()); dsSendMailInfo = objTechService.GetRFQsuppInfoSendEmail(dataItem["SUPPLIER"].Text.ToString(), dataItem["QUOTATION_CODE"].Text, Request.QueryString["Vessel_Code"].ToString(), Request.QueryString["Document_Code"].ToString(), Session["userid"].ToString()); string FileName = "PO_" + Request.QueryString["Vessel_Code"].ToString() + "_" + OrderCode + "_" + dataItem["SUPPLIER"].Text.ToString() + ReplaceSpecialCharacterinFileName(dataItem["SHORT_NAME"].Text) + DateTime.Now.ToString("yyMMddss") + ".pdf"; string sToEmailAddress = "", strSubject = "", strEmailBody = ""; //Generate the PDF file and check the include amount status DataTable dtPO = DsPO.Tables[0]; if (rbtnIncludeAmount.Checked == false) { int ipo = 0; foreach (DataRow dr in dtPO.Rows) { dtPO.Rows[ipo]["currency"] = ""; dtPO.Rows[ipo]["exchange_rate"] = 0; dtPO.Rows[ipo]["quoted_rate"] = 0; dtPO.AcceptChanges(); ipo++; } } GeneratePOAsPDF(dtPO, strPath, FileName); //Attchment.SetValue(strPath + FileName, 0); // objTechService.ChangeSupplierPOStatus(Request.QueryString["Requisitioncode"].ToString(), Request.QueryString["Document_Code"].ToString(), Request.QueryString["Vessel_Code"].ToString()); //Format Email body. FormateEmail(dsSendMailInfo, out sToEmailAddress, out strSubject, out strEmailBody, false, OrderCode); //Send Email to selected supplier. // // Email.SendEMailForPO("*****@*****.**", sToEmailAddress, "", "", strSubject, strEmailBody, Attchment); BLL_Crew_CrewDetails objMail = new BLL_Crew_CrewDetails(); int MailID = 0; MailID = objMail.Send_CrewNotification(0, 0, 0, 0, sToEmailAddress, emailIDcc, "", strSubject, strEmailBody, "", "MAIL", "", UDFLib.ConvertToInteger(Session["USERID"].ToString()), "DRAFT"); string UploadFilePath = ConfigurationManager.AppSettings["PURC_UPLOAD_PATH"]; //string uploadpath = @"\\server01\uploads\Purchase"; string uploadpath = @"uploads\Purchase"; BLL_Infra_Common.Insert_EmailAttachedFile(MailID, FileName, uploadpath + @"\" + FileName); string URL = String.Format("window.open('../crew/EmailEditor.aspx?ID=+" + MailID.ToString() + @"&FILEPATH=" + UploadFilePath + "');"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "k" + MailID.ToString(), URL, true); // ResponseHelper.Redirect("../crew/EmailEditor.aspx?ID=" + MailID.ToString(), "blank", ""); } } else if ((chk.Checked) && dataItem["APPROVED_Status"].Text == "NO") { String msg = String.Format("alert('Purchase order can not be raise because PO has not been approved.');"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true); } } using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase()) { //Update the requistion Stage Status objTechService.InsertRequisitionStageStatus(Request.QueryString["Requisitioncode"].ToString(), Request.QueryString["Vessel_Code"].ToString(), Request.QueryString["Document_Code"].ToString(), "SCN", sRemark, Convert.ToInt32(Session["userid"]), dtQuotationList); } if (i == rgdSuppliers.MasterTableView.Items.Count) { String msg1 = String.Format("window.close();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg1, true); } else { String msg1 = String.Format("alert('Purchase order has been raised successfully.'); "); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg1, true); } BindRequisitionInfo(); //AddToSyncronizer.AddToSyncroNizerData("PURC_Dtl_Supply_Items"); //AddToSyncronizer.AddToSyncroNizerData("PURC_Dtl_Reqsn"); //AddToSyncronizer.AddToSyncroNizerData("PURC_Dtl_Reqsn_Status"); BindGrid(); divpurcomment.Visible = false; btnSendOrder.Enabled = true; } else { String msg2 = String.Format("alert('Select alteast one quotation to raise the PO.')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg2, true); //lblError.Text = "Select alteast one check box to raise the PO."; } } else { String msg3 = String.Format("alert('There is no quotation selected to Send the PO.')"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg3, true); //lblError.Text = "There is No data to Send the Purchase Order"; } }
protected void FormateEmailOnRework(DataSet dsEmailInfo, bool IsExcelBaseRFQ, string strServerIPAdd, out string sEmailAddress, out string strSubject, out string strBody, bool bIsListed, string Attachment) { BLL_PURC_Purchase objpurch = new BLL_PURC_Purchase(); BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); DataTable dtUser = objUser.Get_UserDetails(Convert.ToInt32(Session["USERID"])); StringBuilder sbBody = new StringBuilder(); sEmailAddress = ""; strSubject = ""; strBody = ""; string webExl = ""; string strfeature; string ServerIPAdd = ConfigurationManager.AppSettings["WebQuotSite"].ToString(); webExl = @" Kindly quote by clicking on the below link :<br> <a href=" + strServerIPAdd.Trim() + "'>'" + strServerIPAdd.Trim() + @"</a> <br> User Name : " + dsEmailInfo.Tables[0].Rows[0]["User_name"].ToString() + @"<br> Password : " + dsEmailInfo.Tables[0].Rows[0]["Password"].ToString() + @"<br><br> " ; strfeature = @"<span style='color:Red'> “ANNOUNCEMENT OF NEW FEATURE” </span> <br> We have implemented the below new features for vendors easy convenience. <br> Ability to export this RFQ to Excel and send out to your counterparts.<br> Not required to submit RFQ Excel quotation to office via email. Now this excel RFQ quotation can be directly uploaded to our system at your end. <br><br> <hr/>"; string MailBodySection = @"Dear " + dsEmailInfo.Tables[0].DefaultView[0]["First_Name"].ToString() + @"<br><br> " + webExl + @" <br> Port Name : " + dsEmailInfo.Tables[0].DefaultView[0]["PORT_NAME"].ToString() + @"<br> <br> THIS IS AN ENQUIRY ONLY. IT IS NOT AN ORDER FOR PURCHASE.<br> <br> All quotes must be submitted using this format. We will not accept quotes in any other format. <br> Upon receipt of this request Kindly complete all highlighted cells and return via this mode of transmission. <br><br> Please review quantity, unit of measure, part number, lead time(in days), delivery date and mark changes<br> as required prior sending out the quote. <b>Failure to use this form may result in disqualification.</b><br><br> Special Instruction : If you haven`t received a response from us in 20 working days, Please consider this request to be closed. <br><br> We will require an estimate of total shipment weight if possible, with the quote. <br> In the event you are awarded this requisition, Payment will only be made to the name and address listed on the Quotation. <br><br> <b>IMPORTANT: </b><br> Terms Subject to " + Session["Company_Name_GL"].ToString() + @" standard terms and conditions of purchase.<br> * Please submit your quote urgently by return / within 3 days of receipt of this RFQ. <br><br> <b>Note:</b><br> 1. Insurance will be covered by the vendor’s policy until the goods have been received at the agreed delivery point specified in the order and/or our separate dispatch instructions.<br> 2. No additional goods to this should be supplied without our approval in writing.<br> 3. Please provide appropriate certificate from class maker and/or supplier for the above items.<br> <br><br> Thank you & best regards,<br> " + Session["USERFULLNAME"].ToString() + @"<br> " + dtUser.Rows[0]["Designation"].ToString() + @"<br>" + Convert.ToString(Session["Company_Address_GL"]) + @" Mobile:+65 " + dtUser.Rows[0]["Mobile_Number"].ToString() + @"<br> Email: " + dtUser.Rows[0]["MailID"].ToString() + @"<br> <a href='" + ServerIPAdd.Trim() + "'>" + ServerIPAdd.Trim() + @"</a><br><br>" ; strSubject = "Rework for RFQ No. " + dsEmailInfo.Tables[0].DefaultView[0]["QTN_Contract_Code"].ToString() + " from " + Session["Company_Name_GL"]; strBody = MailBodySection; //To Get Email Address of the supplier sEmailAddress = dsEmailInfo.Tables[0].DefaultView[0]["SuppEmailIDs"].ToString(); if (sEmailAddress == "") { sEmailAddress = "" + dtUser.Rows[0]["MailID"].ToString() + ""; strSubject = "Please Add Email Address"; strBody = "Please Add Email Address of supplier code : " + dsEmailInfo.Tables[0].Rows[0]["SUPPLIER_CODE"].ToString(); } }
public void SendEmailToSupplier(DataSet dsEmailInfo, string strSuppCode, string strServerIPAdd, string Attachment, bool bIsListed, string RFQType, bool IsInsert_Mail) { try { DataTable dtSuppDetails = new DataTable(); string strFormatSubject = "", strFormatBody = "", sToEmailAddress = ""; BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); DataTable dtUser = objUser.Get_UserDetails(Convert.ToInt32(Session["USERID"])); string strEmailAddCc = dtUser.Rows[0]["MailID"].ToString(); int value = Int32.Parse(RFQType); BLL_Crew_CrewDetails objMail = new BLL_Crew_CrewDetails(); int MailID = 0; String URL = ""; string UploadFilePath = ConfigurationManager.AppSettings["PURC_UPLOAD_PATH"]; switch (value) { case 1: // Excel Based RFQ FormateEmail(dsEmailInfo, true, strServerIPAdd, out sToEmailAddress, out strFormatSubject, out strFormatBody, bIsListed, Attachment); MailID = objMail.Send_CrewNotification(0, 0, 0, 0, sToEmailAddress, strEmailAddCc, "", strFormatSubject, strFormatBody, "", "MAIL", "", UDFLib.ConvertToInteger(Session["USERID"].ToString()), "DRAFT"); //string uploadpath = @"\\server01\uploads\Purchase"; string uploadpath = @"uploads\Purchase"; BLL_Infra_Common.Insert_EmailAttachedFile(MailID, FileName, uploadpath + @"\" + FileName); URL = String.Format("window.open('../crew/EmailEditor.aspx?ID=+" + MailID.ToString() + @"&FILEPATH=" + UploadFilePath + "');"); ScriptManager.RegisterStartupScript(thispage, thispage.GetType(), "k" + MailID.ToString(), URL, true); break; case 2: // Web Based RFQ FormateEmail(dsEmailInfo, false, strServerIPAdd, out sToEmailAddress, out strFormatSubject, out strFormatBody, bIsListed, ""); MailID = objMail.Send_CrewNotification(0, 0, 0, 0, sToEmailAddress, strEmailAddCc, "", strFormatSubject, strFormatBody, "", "MAIL", "", UDFLib.ConvertToInteger(Session["USERID"].ToString()), "DRAFT"); //URL = String.Format("alert('web');"); URL = String.Format("window.open('../crew/EmailEditor.aspx?ID=+" + MailID.ToString() + @"&FILEPATH=" + UploadFilePath + "');"); ScriptManager.RegisterStartupScript(thispage, thispage.GetType(), "k" + MailID.ToString(), URL, true); break; case 3: FormateEmailOnRework(dsEmailInfo, false, strServerIPAdd, out sToEmailAddress, out strFormatSubject, out strFormatBody, bIsListed, ""); MailID = objMail.Send_CrewNotification(0, 0, 0, 0, sToEmailAddress, strEmailAddCc, "", strFormatSubject, strFormatBody, "", "MAIL", "", UDFLib.ConvertToInteger(Session["USERID"].ToString()), "READY"); URL = String.Format("window.open('../crew/EmailEditor.aspx?ID=+" + MailID.ToString() + @"&FILEPATH=" + UploadFilePath + "');"); ScriptManager.RegisterStartupScript(thispage, thispage.GetType(), "k" + MailID.ToString(), URL, true); break; } } catch (Exception ex) { } }
protected Boolean ValidateSaving() { string js = ""; int CurrentUserID = GetSessionUserID(); BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); DataTable dt = objUser.Get_UserDetails(CurrentUserID); if (dt.Rows.Count > 0) { if (dt.Rows[0]["Dep_Code"].ToString() == "5")//Technical { if (rdo7.SelectedValue == "0") { js = "Question NO: 7 need to be answered "; } if (rdo10.SelectedValue == "0") { js = "Question NO: 10 need to be answered "; } if (rdo11.SelectedValue == "0") { js = "Question NO: 11 need to be answered "; } if (rdo12.SelectedValue == "0") { js = "Question NO: 12 need to be answered "; } } else if (dt.Rows[0]["Dep_Code"].ToString() == "4")//Operations { if (rdo4.SelectedValue == "0") { js = "Question NO: 4 need to be answered "; } if (rdo5.SelectedValue == "0") { js = "Question NO: 5 need to be answered "; } if (rdo6.SelectedValue == "0") { js = "Question NO: 6 need to be answered "; } if (rdo8.SelectedValue == "0") { js = "Question NO: 8 need to be answered "; } if (rdo9.SelectedValue == "0") { js = "Question NO: 9 need to be answered "; } if (rdo12.SelectedValue == "0") { js = "Question NO: 12 need to be answered "; } } else if (dt.Rows[0]["Dep_Code"].ToString() == "9")//Chartering { if (rdo8.SelectedValue == "0") { js = "Question NO: 8 need to be answered "; } if (rdo9.SelectedValue == "0") { js = "Question NO: 9 need to be answered "; } } else if (dt.Rows[0]["Dep_Code"].ToString() == "7")//SQA { if (rdo4.SelectedValue == "0") { js = "Question NO: 4 need to be answered "; } if (rdo5.SelectedValue == "0") { js = "Question NO: 5 need to be answered "; } } } if (ddlRank.SelectedValue == "0") { js = "Select Rank"; } else if (rdoEnglishRead.SelectedValue == "" || rdoEnglishWrite.SelectedValue == "" || rdoEnglishComm.SelectedValue == "") { js = "All options related to Question NO: 1 need to be answered "; } else if (rdo2.SelectedValue == "0") { js = "Question NO: 2 need to be answered "; } else if (rdo3.SelectedValue == "0") { js = "Question NO: 3 need to be answered "; } else if (rdoSelected.SelectedIndex == -1) { js = "Please mention if the crew is Approved or Rejected"; } else if (txtResultText.Text == "") { js = "Enter your comment for the crew"; } if (rdoSelected.SelectedIndex == 0) { int Count = 0; foreach (ListItem li in lstVessels.Items) { if (li.Selected == true) { Count++; } } if (Count == 0) { js = "Select recomended vessel(s)."; } Count = 0; foreach (ListItem li in chkTradingArea.Items) { if (li.Selected == true) { Count++; } } if (Count == 0) { js = "Select recomended trade zone(s)."; } } if (rdo2.SelectedValue == "4" && txtRemark2.Text == "") { js = "Enter remarks for Question NO: 2"; } else if (rdo3.SelectedValue == "4" && txtRemark3.Text == "") { js = "Enter remarks for Question NO: 3"; } else if (rdo4.SelectedValue == "4" && txtRemark4.Text == "") { js = "Enter remarks for Question NO: 4"; } else if (rdo5.SelectedValue == "4" && txtRemark5.Text == "") { js = "Enter remarks for Question NO: 5"; } else if (rdo6.SelectedValue == "4" && txtRemark6.Text == "") { js = "Enter remarks for Question NO: 6"; } else if (rdo7.SelectedValue == "4" && txtRemark7.Text == "") { js = "Enter remarks for Question NO: 7"; } else if (rdo8.SelectedValue == "4" && txtRemark8.Text == "") { js = "Enter remarks for Question NO: 8"; } else if (rdo9.SelectedValue == "4" && txtRemark9.Text == "") { js = "Enter remarks for Question NO: 9"; } else if (rdo10.SelectedValue == "4" && txtRemark10.Text == "") { js = "Enter remarks for Question NO: 10"; } else if (rdo11.SelectedValue == "4" && txtRemark11.Text == "") { js = "Enter remarks for Question NO: 11"; } else if (rdo12.SelectedValue == "4" && txtRemark12.Text == "") { js = "Enter remarks for Question NO: 12"; } if (js.Length > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "alertUser", "alert('" + js + "');", true); return(false); } else { return(true); } }
protected void Page_Load(object sender, EventArgs e) { calEvaDate.Format = UDFLib.GetDateFormat(); if (Session["USERFULLNAME"] == null) { Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { int CrewID = UDFLib.ConvertToInteger(Request.QueryString["CrewID"].ToString()); int Evaluation_ID = UDFLib.ConvertToInteger(Request.QueryString["EID"].ToString()); try { lblMonth.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(Request.QueryString["M"])); } catch { lblMonth.Text = Request.QueryString["M"]; } Load_CrewPersonalDetails(CrewID); DataTable dtEval = BLL_Crew_Evaluation.Get_Evaluations(Evaluation_ID); if (dtEval.Rows.Count > 0) { lblEvalName.Text = dtEval.Rows[0]["Evaluation_Name"].ToString(); } DataTable dt1 = objUser.Get_UserDetails(Convert.ToInt32(Session["USERID"].ToString())); if (dt1.Rows.Count > 0) { int LoggedInUserCrewId = UDFLib.ConvertToInteger(dt1.Rows[0]["CrewId"].ToString()); DataTable dt = objBLLCrew.Get_CrewPersonalDetailsByID(LoggedInUserCrewId); if (dt.Rows.Count > 0) { string rank = dt.Rows[0]["Rank_Short_Name"].ToString() == "" ? "" : dt.Rows[0]["Rank_Short_Name"].ToString() + "-"; string staffCode = dt.Rows[0]["Staff_Code"].ToString() == "" ? "" : dt.Rows[0]["Staff_Code"].ToString() + "-"; lnkEvaluator.Text = rank + staffCode + Session["USERFULLNAME"].ToString(); lnkEvaluator.NavigateUrl = "~/Crew/CrewDetails.aspx?ID=" + dt.Rows[0]["ID"].ToString(); EvalLibRank = rank; Evaluator_CrewDtlID = dt.Rows[0]["ID"].ToString(); //Evaluator_CrewDtlID = dt.Rows[0]["Evaluator_CrewDtlID"].ToString(); } } if (Request.QueryString["DtlID"] != null) { string Dtl_Evaluation_ID = Request.QueryString["DtlID"].ToString(); Bind_EvaluationResult(); string Office_ID = hdnOffice_ID.Value.ToString(); string Vessel_ID = hdnVessel_ID.Value.ToString(); btnSaveEvaluation.Enabled = false; if (Dtl_Evaluation_ID != "" && Office_ID != "" && Vessel_ID != "") { if (BLL_Crew_Evaluation.Get_CrewEvaluation_FeedbackCount(GetSessionUserID(), Convert.ToInt32(Dtl_Evaluation_ID), Convert.ToInt32(Office_ID), Convert.ToInt32(Vessel_ID)) > 0) { lnkReqFeedBk.BackColor = System.Drawing.Color.Yellow; } DataSet ds = BLL_Crew_Evaluation.Get_CrewEvaluation_Verification(UDFLib.ConvertToInteger(CrewID), UDFLib.ConvertToInteger(Dtl_Evaluation_ID), UDFLib.ConvertToInteger(Office_ID), UDFLib.ConvertToInteger(Vessel_ID)); if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["VerifiedBy"].ToString() != "") { btnSaveFollowUpAndClose.Visible = false; txtMessage.Text = ds.Tables[0].Rows[0]["VerificationComment"].ToString(); txtMessage.ReadOnly = true; } else { btnSaveFollowUpAndClose.Enabled = true; txtMessage.ReadOnly = false; } } else { btnSaveFollowUpAndClose.Visible = false; txtMessage.Visible = false; txtVerificationComment.Visible = false; } } else { btnSaveFollowUpAndClose.Visible = false; txtMessage.Visible = false; txtVerificationComment.Visible = false; } string Show_Dashboard = String.Format("AsyncFeedbackHistory();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", Show_Dashboard, true); dvEvalutionFooter.Visible = true; dvEvalutionFooter.InnerHtml = GetEvaluationSignatureDetails(UDFLib.ConvertToInteger(Request.QueryString["SchID"].ToString()), Evaluation_ID); if (Request.QueryString.ToString().Contains("DshBrd")) { if (Request.QueryString["DshBrd"].ToString() != null) { InsertDel_ActionDetails(CrewID, UDFLib.ConvertToInteger(Request.QueryString["SchID"].ToString()), 0); } } return; } } else { Bind_AssignedCriteria(); txtEvaDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(DateTime.Today)); lnkReqFeedBk.Visible = false; lnkAddFeedBk.Visible = false; lnkHide.Visible = false; lnkShow.Visible = false; btnSaveFollowUpAndClose.Visible = false; txtMessage.Visible = false; txtVerificationComment.Visible = false; } if (Request.QueryString.ToString().Contains("DshBrd")) { if (Request.QueryString["DshBrd"].ToString() != null) { InsertDel_ActionDetails(CrewID, UDFLib.ConvertToInteger(Request.QueryString["SchID"].ToString()), 0); } } } }
protected void SendPurchaseOrder() { // string[] Attchment = new string[10]; lblError.Text = ""; string strPath = Server.MapPath(".") + "\\SendPO\\"; DataTable DsPO = new DataTable(); DataSet dsSendMailInfo = new DataSet(); BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); DataTable dtUser = objUser.Get_UserDetails(Convert.ToInt32(Session["USERID"])); string emailIDcc = dtUser.Rows[0]["MailID"].ToString(); bool IsPO = false; int i = 0; string sDlvIns = txtdlvins.Text != "" ? txtdlvins.Text : DBNull.Value.ToString(); string strDeliveryPort = DDLPort.SelectedItem.ToString() != "--Select--" ? DDLPort.SelectedValue.ToString() : DBNull.Value.ToString(); string sEta = txteta.Text != "" ? txteta.Text + " " + txtETAAPPM.Text.ToString().Trim() + ":00" : Convert.ToString("01/01/1900"); string sRemark = txtremark.Text != "" ? txtremark.Text : DBNull.Value.ToString(); string sAgent = txtagent.Text != "" ? txtagent.Text : DBNull.Value.ToString(); string sEtd = txtetd.Text != "" ? txtetd.Text + " " + txtETDAMPM.Text.ToString().Trim() + ":00" : Convert.ToString("01/01/1900"); foreach (GridViewRow gvRow in gvLPOList.Rows) { CheckBox chk = (CheckBox)(gvRow.FindControl("chkSelectLPO") as CheckBox); string order_code = gvLPOList.DataKeys[gvRow.RowIndex].Value.ToString(); if ((chk.Checked)) { string OrderCode = gvLPOList.DataKeys[gvRow.RowIndex].Value.ToString(); int sts = BLL_PURC_LOG.Upd_Log_Order_Details(sDlvIns, strDeliveryPort, DateTime.Parse(sEta), sRemark, DateTime.Parse(sEtd), sAgent, Request.QueryString["LOG_ID"], order_code, Convert.ToInt32(Session["USERID"])); DsPO = BLL_PURC_LOG.Get_Log_Raise_PO(order_code, Request.QueryString["LOG_ID"]); dsSendMailInfo = BLL_PURC_LOG.Get_RaisePO_EmailInfo(order_code, Request.QueryString["LOG_ID"], Convert.ToInt32(Session["USERID"])); string FileName = "PO_" + OrderCode + "_" + ReplaceSpecialCharacterinFileName(DsPO.Rows[0]["SHORT_NAME"].ToString()) + DateTime.Now.ToString("yyMMddss") + ".pdf"; string sToEmailAddress = "", strSubject = "", strEmailBody = ""; //Generate the PDF file and check the include amount status DataTable dtPO = DsPO; if (rbtnIncludeAmount.Checked == false) { int ipo = 0; foreach (DataRow dr in dtPO.Rows) { dtPO.Rows[ipo]["currency"] = ""; dtPO.Rows[ipo]["exchange_rate"] = 0; dtPO.Rows[ipo]["quoted_rate"] = 0; dtPO.AcceptChanges(); ipo++; } } GeneratePOAsPDF(dtPO, strPath, FileName); FormateEmail(dsSendMailInfo, out sToEmailAddress, out strSubject, out strEmailBody, false, OrderCode); BLL_Crew_CrewDetails objMail = new BLL_Crew_CrewDetails(); int MailID = 0; MailID = objMail.Send_CrewNotification(0, 0, 0, 0, sToEmailAddress, emailIDcc, "", strSubject, strEmailBody, "", "MAIL", "", UDFLib.ConvertToInteger(Session["USERID"].ToString()), "DRAFT"); string UploadFilePath = ConfigurationManager.AppSettings["PURC_UPLOAD_PATH"]; //string uploadpath = @"\\server01\uploads\Purchase"; string uploadpath = @"uploads\Purchase"; BLL_Infra_Common.Insert_EmailAttachedFile(MailID, FileName, uploadpath + @"\" + FileName); string URL = String.Format("window.open('../crew/EmailEditor.aspx?ID=+" + MailID.ToString() + @"&FILEPATH=" + UploadFilePath + "');"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "k" + MailID.ToString(), URL, true); // ResponseHelper.Redirect("../crew/EmailEditor.aspx?ID=" + MailID.ToString(), "blank", ""); } } String msg1 = String.Format("window.open('','_self') ;window.close() ;"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg1, true); dvRaiselPo.Visible = false; btnSendOrder.Enabled = true; }
protected void ImgbtnReSendPO_Click(object s, CommandEventArgs e) { try { string[] strIds = e.CommandArgument.ToString().Split(','); string Requisitioncode = strIds[0].ToString(); string Document_Code = strIds[1].ToString(); string Vessel_Code = strIds[2].ToString(); string SUPPLIER = strIds[3].ToString(); string OrderCode = strIds[4].ToString(); string QUOTATION_CODE = strIds[5].ToString(); string strPath = Server.MapPath(".") + "\\SendPO\\"; DataSet DsPO = new DataSet(); DataSet dsSendMailInfo = new DataSet(); BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); DataTable dtUser = objUser.Get_UserDetails(Convert.ToInt32(Session["USERID"])); string emailIDcc = dtUser.Rows[0]["MailID"].ToString(); using (BLL_PURC_Purchase objTechService = new BLL_PURC_Purchase()) { DsPO = objTechService.GetDataToGeneratPO(Requisitioncode, Vessel_Code, SUPPLIER, QUOTATION_CODE, Document_Code); dsSendMailInfo = objTechService.GetRFQsuppInfoSendEmail(SUPPLIER, QUOTATION_CODE, Vessel_Code, Document_Code, Session["userid"].ToString()); string FileName = "PO_" + Vessel_Code + "_" + OrderCode + "_" + SUPPLIER + DateTime.Now.ToString("yyMMddss") + ".pdf"; string sToEmailAddress = "", strSubject = "", strEmailBody = ""; //Generate the PDF file and check the include amount status DataTable dtPO = DsPO.Tables[0]; GeneratePOAsPDF(dtPO, strPath, FileName); FormateEmail(dsSendMailInfo, out sToEmailAddress, out strSubject, out strEmailBody, false, OrderCode); BLL_Crew_CrewDetails objMail = new BLL_Crew_CrewDetails(); int MailID = 0; MailID = objMail.Send_CrewNotification(0, 0, 0, 0, sToEmailAddress, emailIDcc, "", strSubject, strEmailBody, "", "MAIL", "", UDFLib.ConvertToInteger(Session["USERID"].ToString()), "DRAFT"); string UploadFilePath = ConfigurationManager.AppSettings["PURC_UPLOAD_PATH"]; //string uploadpath = @"\\server01\uploads\Purchase"; string uploadpath = @"uploads\Purchase"; BLL_Infra_Common.Insert_EmailAttachedFile(MailID, FileName, uploadpath + @"\" + FileName); string URL = String.Format("window.open('../crew/EmailEditor.aspx?ID=+" + MailID.ToString() + @"&FILEPATH=" + UploadFilePath + "');"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "k" + MailID.ToString(), URL, true); } } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void Page_Load(object sender, EventArgs e) { try { if (Convert.ToString(Session["USERID"]) == "") { Response.Write("<center><br><br><h2><font color=gray>Session is lost. Please click on the Logout option and login again.</font></h2></center>"); Response.End(); } if (Request.QueryString["DocVer"] != null) { if (Request.QueryString["DocVer"].ToString() != "") { string[] temp = Request.QueryString["DocVer"].ToString().Split('-'); DocID = temp[0]; DocVersion = temp[1]; } } else { DocID = Request.QueryString["DocID"]; } DataSet dsFileDetails = objQMS.getFileDetailsByID(UDFLib.ConvertToInteger(DocID), UDFLib.ConvertToInteger(DocVersion)); if (dsFileDetails.Tables[0].Rows.Count > 0) { DataRow dr = dsFileDetails.Tables[0].Rows[0]; hfDocName.Value = lblDocName.Text = dr["LogFileID"].ToString(); if (DocVersion == "0") { DocVersion = dr["Version"].ToString(); if (dr["Created_By"].ToString() == "0") { lblOppStatus.Text = dr["Operation_Type"].ToString() == "" ? "CREATED by Office on " + ConvertDateToString(dr["Date_Of_Creatation"].ToString(), "dd-MMM-yy HH:mm") : dr["Operation_Type"].ToString() + " by " + dr["first_name"].ToString().ToUpper() + " on " + ConvertDateToString(dr["Operation_Date"].ToString(), "dd-MMM-yy HH:mm"); } else { lblOppStatus.Text = dr["Operation_Type"].ToString() == "" ? "CREATED by " + dr["CreatedBYFirstName"].ToString() + " on " + ConvertDateToString(dr["Date_Of_Creatation"].ToString(), "dd-MMM-yy HH:mm") : dr["Operation_Type"].ToString() + " by " + dr["first_name"].ToString().ToUpper() + " on " + ConvertDateToString(dr["Operation_Date"].ToString(), "dd-MMM-yy HH:mm"); } } else { if (DocVersion == dr["Version"].ToString()) { lblOppStatus.Text = dr["Operation_Type"].ToString() == "" ? "CREATED by " + dr["first_name"].ToString() + " on " + ConvertDateToString(dr["Date_Of_Creatation"].ToString(), "dd-MMM-yy HH:mm") : dr["Operation_Type"].ToString() + " by " + dr["first_name"].ToString().ToUpper() + " on " + ConvertDateToString(dr["Operation_Date"].ToString(), "dd-MMM-yy HH:mm"); } else { lblOppStatus.Text = "<b>You are viewing older version of the file.</b>"; } } lblCurrentVersion.Text = DocVersion; OppStatus = dr["Operation_Type"].ToString(); OppUserID = dr["userid"].ToString(); string VersionFilePath = ""; //for file Approval History int rowCount = 0; DataTable dtApproval_Level = objQMS.QMS_Check_FileApprovalExists(UDFLib.ConvertToInteger(DocID), null, null, null, null, null, null, ref rowCount); if (dtApproval_Level.Rows.Count > 0 && dtApproval_Level.Rows[dtApproval_Level.Rows.Count - 1]["Approval_Status"].ToString() == "0") { int index = 0; foreach (DataRow row in dtApproval_Level.Rows) { if (row["Approval_Status"].ToString() == "0") { index = Convert.ToInt32(row["LevelID"].ToString()); break; } } int User_ID = 0; if (index > 0) { User_ID = Convert.ToInt32(dtApproval_Level.Rows[index - 1]["ApproverID"].ToString()); } else if (index == 0) { User_ID = Convert.ToInt32(dtApproval_Level.Rows[index]["ApproverID"].ToString()); } BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials(); DataTable dtUser = objUser.Get_UserDetails(User_ID); lblUser.Text = dtUser.Rows[0]["User_name"].ToString(); dvMain.Visible = false; divApprovalMessage.Visible = true; lblDocName1.Text = lblDocName.Text; lblCurrentVersion1.Text = lblCurrentVersion.Text; lblOppStatus1.Text = lblOppStatus.Text; } else { LatestFilePath = dr["FilePath"].ToString(); dvMain.Visible = true; divApprovalMessage.Visible = false; } } UserAccessValidation(); } catch (Exception ex) { throw ex; } }