Пример #1
0
        private void btnDeleted_Click(object sender, EventArgs e)
        {
            ShippingInformationDTO oRow = (ShippingInformationDTO)gcv_SevkBilgileri.GetFocusedRow();

            if (oRow != null)
            {
                if (get_Question("Kayıt Silinecektir. Onaylıyor musunuz?"))
                {
                    var result = _repository.Run <CurrentTransactionsService, ActionResponse <ShippingInformationDTO> >(x => x.DeleteShippingInformation(oRow.RecId));
                    do_SevkAdressTabsList();
                }
            }
        }
Пример #2
0
        private void gcv_SevkBilgileri_Click(object sender, EventArgs e)
        {
            __ShippingInformation = (ShippingInformationDTO)gcv_SevkBilgileri.GetFocusedRow();
            if (__ShippingInformation != null)
            {
                bs_ShipEdit.DataSource = __ShippingInformation;

                //txtRecId.Text = Convert.ToString(oRow.RecId);
                //txtAdresTanimi.Text = oRow.AdressDefinition;
                //txtAdress.Text = oRow.Adress;
                //txtIlce.Text = oRow.County;
                //txtUlke.Text = oRow.Country;
                //txtİl.Text = oRow.District;
                //txtTelefon.Text = oRow.Phone;
                //txtYetkili.Text = oRow.Authorized;
            }
        }
Пример #3
0
        public ActionResponse <ShippingInformationDTO> SaveShippingInformation(ShippingInformationDTO model)
        {
            ActionResponse <ShippingInformationDTO> response = new ActionResponse <ShippingInformationDTO>()
            {
                Response     = model,
                ResponseType = ResponseType.Ok
            };

            using (MspDbContext _db = new MspDbContext())
            {
                try
                {
                    if (response.Response.RecId == 0)
                    {
                        _db.ShippingInformation.Add(base.Map <ShippingInformationDTO, ShippingInformation>(model));
                        _db.SaveChanges();
                    }
                    else
                    {
                        var entity = _db.ShippingInformation.FirstOrDefault(x => x.RecId == response.Response.RecId);
                        if (entity != null)
                        {
                            _db.Entry(entity).CurrentValues.SetValues(model);
                            _db.Entry(entity).State = System.Data.Entity.EntityState.Modified;
                        }
                    }
                    _db.SaveChanges();
                }
                catch (Exception e)
                {
                    response.Message      = e.ToString();
                    response.ResponseType = ResponseType.Error;
                }
            }
            return(response);
        }
Пример #4
0
 private void btnYeni_Click(object sender, EventArgs e)
 {
     __ShippingInformation  = new ShippingInformationDTO();
     bs_ShipEdit.DataSource = __ShippingInformation;
 }