示例#1
0
        public WorkList UpdateVndRole(int OrderNbr, int VndRoleNbr, string StatusCode)
        {
            var wl = new WorkList();

            using (var conn = new SqlConnection(SQL_CONNECTION_STRING))
                using (var command = new SqlCommand("s_wUpdateVndRole", conn)
                {
                    CommandType = System.Data.CommandType.StoredProcedure
                })
                {
                    try
                    {
                        command.Parameters.AddWithValue("@OrderNbr", OrderNbr);
                        command.Parameters.AddWithValue("@VndRoleNbr", VndRoleNbr);
                        command.Parameters.AddWithValue("@StatusCode", StatusCode);
                        conn.Open();
                        command.ExecuteNonQuery();
                        wl.RetVal = "Sucess!";
                    }
                    catch (Exception ex)
                    {
                        wl.RetVal = ex.Message.ToString();
                    }

                    return(wl);
                }
        }
示例#2
0
        public WorkList Notify(int OrderNbr, int NotifyType)
        {//http://localhost:57559/api/Notify/?OrderNbr=1&NotifyType=1
            var wl = new WorkList();
            var oh = new OrderHeader();

            oh = GetOrderHeader(OrderNbr);
            MailAddress from    = new MailAddress("*****@*****.**");
            MailAddress to      = new MailAddress(oh.EMAIL);
            MailMessage message = new MailMessage(from, to);

            var PPPNote = "In addition, please access "
                          + "http://www.macysnet.com/Routing/ShippingUpdateForm.html "
                          + "to submit the Shipment Address Update Form "
                          + "to activate your company-specific e-mail address "
                          + "for communication of shipment specific information. ";

            switch (NotifyType)
            {
            case 1:
                message.Subject = "MacysNet Registration";
                message.Body    = @"You will be notified when your account is activated. " + PPPNote;
                break;

            case 2:
                message.Subject = "Your MacysNet Account Is Ready";
                message.Body    = @"Your account is activated. You may access MacysNet at http://www.macysnet.com " + PPPNote;
                break;

            case 3:
                message.Subject = "Your MacysNet Profile";
                message.Body    = @"Your MacysNet profile has been updated. " + PPPNote;
                break;

            case 4:
                message.Subject = "Your MacysNet account Is Ready";
                message.Body    = @"Your account is activated. You may access MacysNet at http://www.macysnet.com " + PPPNote;
                break;

            default:
                message.Subject = "MacysNet Registration Error";
                message.Body    = @"Registration OrderNbr ";
                break;
            }

            SmtpClient client = new SmtpClient("appmail.fds.com");

            try
            {
                client.Send(message);
                wl.RetVal = "Success";
            }
            catch (Exception ex)
            {
                wl.RetVal = ex.ToString();
            }

            return(wl);
        }
示例#3
0
        public WorkList WorkListIns(int OrderNbr, string Instructions, string Comments, int AdminID, bool CompletedFlag)
        {//http://localhost:57559/api/WLInsert/?OrderNbr=1&Instructions=Testing&Comments=NULL&AdminID=1&CompleteFlag=false
            var wl = new WorkList();

            using (var conn = new SqlConnection(SQL_CONNECTION_STRING))
                using (var command = new SqlCommand("s_wInsertItem", conn)
                {
                    CommandType = System.Data.CommandType.StoredProcedure
                })
                {
                    command.Parameters.AddWithValue("@OrderNbr", OrderNbr);
                    command.Parameters.AddWithValue("@Instructions", Instructions);
                    command.Parameters.AddWithValue("@Comments", Comments);
                    command.Parameters.AddWithValue("@AdminId", AdminID);
                    command.Parameters.AddWithValue("@CompletedFlag", CompletedFlag);
                    var returnParameter = command.Parameters.Add("@RetVal", System.Data.SqlDbType.Int);
                    returnParameter.Direction = System.Data.ParameterDirection.Output;
                    conn.Open();
                    command.ExecuteNonQuery();
                    wl.RetVal = returnParameter.Value.ToString();

                    return(wl);
                }
        }