Ejemplo n.º 1
0
        public frmSearchCustomer()
        {
            InitializeComponent();
            mySQLFunc.initialize_global_variables();

            cls_globalfunc.formaddkbkpevent(this);

            this.dgvCustomer.AutoGenerateColumns = false;
            this.customer = new cls_customer();
        }
Ejemplo n.º 2
0
 public IHttpActionResult Insert([FromBody] cls_customer c)
 {
     if (cls_token.validate(c))
     {
         long         loginid   = cls_token.GetLoginId(c.Token.Key).Value;
         long         idcompany = cls_login.GetCompanyIdByIdLogin(loginid);
         cls_customer customer  = c;
         c.Id_company = idcompany;
         customer.save();
         return(Ok());
     }
     else
     {
         return(Unauthorized());
     }
 }
Ejemplo n.º 3
0
        private void addcustomer()
        {
            if (dgvCustomer.SelectedRows.Count <= 0)
            {
                return;
            }
            long SyncId = Convert.ToInt32(dgvCustomer.SelectedRows[0].Cells["colWid"].Value);

            frmLoad loadForm = new frmLoad("Loading Customer Data", "Loading Screen");

            loadForm.BackgroundWorker.DoWork += (sender, e1) =>
            {
                this.customer = new cls_customer(SyncId);
            };
            loadForm.ShowDialog();
            this.Close();
        }
Ejemplo n.º 4
0
 public IHttpActionResult GetByInternalId(business_base_class c)
 {
     try
     {
         if (cls_token.validate(c))
         {
             long         loginid   = cls_token.GetLoginId(c.Token.Key).Value;
             long         idcompany = cls_login.GetCompanyIdByIdLogin(loginid);
             cls_customer cust      = cls_customer.GetCustomerByInternalID(c.Id);
             return(Ok(cust));
         }
         else
         {
             return(Unauthorized());
         }
     }
     catch (Exception e)
     {
         log.insertLog(e, 0, 0);
         return(InternalServerError(e));
     }
 }