protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { hfUserID.Value = Context.User.Identity.Name; chkTUAIP.Visible = ReturnSiteVariables.ReturnAppImplementsTUAIP(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { hfUserID.Value = Context.User.Identity.Name; // Allow users to Implement Transfer Using Alternate Item Policy: chkTUAI.Visible = ReturnSiteVariables.ReturnAppImplementsTUAIP(); //Response.Write(settings.ImplementsTUAIP); //CheckConnection(); } }
public static void WriteSubConSupplyTransaction(string strItemNumber, string strWarehouse, string strItemUOM, DateTime dtTransactionDt, string strIssueLocation, string strRecWH, string strRecLocation, decimal decSupplyQuantity, string strItemDesc, decimal decCurrUpdationDt, decimal decCurrUpdationTm, string strUserName) { // step 1 from the Issue Warehouse to Application's Inventory Control, Insert if required if (1 != 1) { InsertMI5RSHDP(strItemNumber, strItemDesc, ReturnSiteVariables.ReturnAppInvControlWarehouse(), decSupplyQuantity, decCurrUpdationDt, decCurrUpdationTm, strUserName); InsertMI5RSRDP(strItemNumber, ReturnSiteVariables.ReturnAppInvControlWarehouse(), strItemUOM, "", decSupplyQuantity, ReturnSiteVariables.ReturnAppInvControl(), strItemDesc, decCurrUpdationDt, decCurrUpdationTm, strUserName); } // else update the already existing file with different Item Number, Quantity else { UpdateRecieveSupplyFiles(decSupplyQuantity, decCurrUpdationDt, decCurrUpdationTm, strUserName, ReturnSiteVariables.ReturnAppInvControlWarehouse(), strItemNumber, "00001", " ", " "); } // Insert the Supply Detail file with transaction InsertMI5RSSDP(strItemNumber, strWarehouse, "TW", "001", "001", "0", decSupplyQuantity, Convert.ToDecimal(dtTransactionDt.ToString("ddMMyyyy")), strIssueLocation, " ", strItemDesc, ReturnSiteVariables.ReturnAppInvControlWarehouse(), ReturnSiteVariables.ReturnAppInvControl(), decCurrUpdationDt, decCurrUpdationTm, strUserName); WriteOfflineTransactions("001", strItemNumber, ReturnSiteVariables.ReturnAppInvControlWarehouse(), strWarehouse, decSupplyQuantity, strItemUOM, " ", strIssueLocation, CommonFunctions.ConvertAppDateToCMapicsFormat(dtTransactionDt), ReturnSiteVariables.ReturnAppInvControl()); // Step 2. write Normal supply transaction to from Application Inventory to SubCon WriteSupplyTransactions("001", strItemNumber, strItemDesc, strRecWH, ReturnSiteVariables.ReturnAppInvControlWarehouse(), decSupplyQuantity, strItemUOM, "0", " ", "001", ReturnSiteVariables.ReturnAppInvControl(), dtTransactionDt, strRecLocation, strUserName); }
public static bool SendNewRequisitionEmail(int RequisitionId, string senderWarehouse, string senderLocation, string recieverWarehouse, string recieverLocation, string subject, string message) { bool sent = false; string from = String.Format("{0} <{1}>", senderWarehouse + " : " + senderLocation, LocationsEmailAddress(senderWarehouse, senderLocation)); StringBuilder sb = new StringBuilder(); sb.AppendFormat("You have a new Requisition!"); sb.AppendLine(); sb.AppendLine(); sb.AppendLine("The Requisition is: " + message); sb.AppendLine(); sb.AppendLine(); sb.AppendLine("The user information is below:"); sb.AppendLine(); //sb.AppendLine("Requestor: "); sb.AppendLine("Warehouse: " + senderWarehouse + " Location: " + senderLocation); sb.AppendLine(); sb.AppendLine(ReturnSiteVariables.ReturnAppCompanyName()); sb.AppendLine(PMSHttpApplication.SiteUrl); try { MailMessage m = new MailMessage(from, LocationsEmailAddress(recieverWarehouse, recieverLocation)); SmtpSection smtpSec = (SmtpSection)ConfigurationManager.GetSection("system.net/mailSettings/smtp"); m.Subject = ReturnSiteVariables.ReturnAppApplicationName() + " - " + subject; m.Body = sb.ToString(); SmtpClient client = new SmtpClient(); client.Host = smtpSec.Network.Host; client.Send(m); sent = true; } catch { // Not Sent. sent = false; } return(sent); }
public static string FunGetLocationEmail(string Warehouse, string Location) { string ConnStr = ConfigurationManager.ConnectionStrings["PMSdbConnection"].ConnectionString; SqlConnection conn = new SqlConnection(ConnStr); SqlCommand cmd = new SqlCommand(); Object returnValue; cmd.CommandText = "SELECT Email FROM vwLocationEmailAddress WHERE Warehouse = '" + Warehouse + "' and LocationsAccess = '" + Location + "'"; cmd.CommandType = CommandType.Text; cmd.Connection = conn; conn.Open(); returnValue = cmd.ExecuteScalar(); conn.Close(); string LocationEmail = (string)returnValue; if (LocationEmail != "") { return(LocationEmail); } else { return(ReturnSiteVariables.ReturnAppEmailAddress()); } }
protected void ddlToLocation_DataBound(object sender, EventArgs e) { if (ddlToLocation.Items.Count > 0) { ddlToLocation.SelectedIndex = ddlToLocation.Items.IndexOf(ddlToLocation.Items.FindByText(ReturnSiteVariables.ReturnAppInvControl().ToString())); lblToLocationDesc.Text = ddlToLocation.SelectedItem.Value; } else { lblToLocationDesc.Text = ""; } }