Esempio n. 1
0
        public static void Update(Shipping v, DAL dalsession)
        {
            string q = "UPDATE " + SHIPPING.SHIPPING_TBL + " SET";

            q += " " + SHIPPING.SHIPPING_NAME + " = @" + SHIPPING.SHIPPING_NAME + "@ \r\n ";
            q += "," + SHIPPING.NOTES + " = @" + SHIPPING.NOTES + "@ \r\n ";
            q += "," + SHIPPING.ACTIVE_ID + " = @" + SHIPPING.ACTIVE_ID + "@ \r\n ";
            q += "," + SHIPPING.USER_ID + " = @" + SHIPPING.USER_ID + "@ \r\n ";
            q += "  WHERE " + SHIPPING.SHIPPING_ID + " = @" + SHIPPING.SHIPPING_ID + "@ ";
            q  = AttachParams(q, v);
            dalsession.Execute(q);
        }
Esempio n. 2
0
        private Shipping CollectData()
        {
            Shipping fobj = new Shipping()
            {
                Shipping_id   = vId,
                Shipping_name = txt_shipping_name.Text,
                Active_id     = Core.Stative,
                Notes         = txt_notes.Text,
                User_id       = Current.User
            };

            return(fobj);
        }
Esempio n. 3
0
        public static void Insert(Shipping v, DAL dalsession)
        {
            string q = " INSERT INTO " + SHIPPING.SHIPPING_TBL + " ( ";

            q += " " + SHIPPING.SHIPPING_NAME + " \r\n ";
            q += "," + SHIPPING.NOTES + " \r\n ";
            q += "," + SHIPPING.ACTIVE_ID + " \r\n ";
            q += "," + SHIPPING.USER_ID + " \r\n ";
            q += " ) VALUES ( ";
            q += "  @" + SHIPPING.SHIPPING_NAME + "@ \r\n ";
            q += ", @" + SHIPPING.NOTES + "@ \r\n ";
            q += ", @" + SHIPPING.ACTIVE_ID + "@ \r\n ";
            q += ", @" + SHIPPING.USER_ID + "@ \r\n ";
            q += " ) \r\n ";
            q  = AttachParams(q, v);
            dalsession.Execute(q);
        }
Esempio n. 4
0
 private static Shipping EntityData(string q)
 {
     using (IDataReader redr = new DAL().Listreader(q))
     {
         while (redr.Read() == true)
         {
             Shipping obj = new Shipping()
             {
                 Shipping_id   = redr[SHIPPING.SHIPPING_ID].ToString(),
                 Shipping_name = redr[SHIPPING.SHIPPING_NAME].ToString(),
                 Notes         = redr[SHIPPING.NOTES].ToString(),
                 Active_id     = redr[SHIPPING.ACTIVE_ID].ToString(),
                 User_id       = redr[USER.USER_NAME].ToString()
             };
             return(obj);
         }
         redr.Close();
         return(new Shipping());
     }
 }
Esempio n. 5
0
        public void SetAction(BtnEvent action, string pk)
        {
            fAction = action;

            switch (fAction)
            {
            case BtnEvent.Open:
                btn_save.Text = "&CLOSE";
                obj           = CShipping_exten.PKId(pk);
                this.EnableControls(false);
                break;

            case BtnEvent.New:
                btn_save.Text = "&SAVE";
                obj           = CShipping.GetNew;
                this.EnableControls(true);
                break;

            case BtnEvent.Edit:
                btn_save.Text = "&UPDATE";
                obj           = CShipping_exten.PKId(pk);
                this.EnableControls(true);
                break;

            case BtnEvent.Delete:
                btn_save.Text = "CONFIRM\r\n&DELETE";
                obj           = CShipping_exten.PKId(pk);
                this.EnableControls(false);
                break;

            case BtnEvent.Print:
                btn_save.Text = "&PRINT";
                obj           = CShipping_exten.PKId(pk);
                this.EnableControls(false);
                break;
            }

            this.LoadData();
        }
Esempio n. 6
0
        private static List <Shipping> EntityList(string q)
        {
            List <Shipping> list = new List <Shipping>();

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    Shipping obj = new Shipping()
                    {
                        Shipping_id   = redr[SHIPPING.SHIPPING_ID].ToString(),
                        Shipping_name = redr[SHIPPING.SHIPPING_NAME].ToString(),
                        Notes         = redr[SHIPPING.NOTES].ToString(),
                        Active_id     = redr[SHIPPING.ACTIVE_ID].ToString(),
                        User_id       = redr[USER.USER_NAME].ToString()
                    };

                    list.Add(obj);
                }

                redr.Close();
            }
            return(list);
        }