Пример #1
0
        public bool AddStore(StoreViewModel model)
        {
            var file = model.License_Image_Copy;

            byte[] ImageBytes = null;
            bool   flag       = false;

            if (file != null)
            {
                //var fileName = Path.GetFileName(file.FileName);
                //var fileExtension = Path.GetExtension(file.FileName);
                //var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(file.FileName);

                file.SaveAs(HttpContext.Current.Server.MapPath("/img/" + file.FileName));

                BinaryReader reader = new BinaryReader(file.InputStream);
                ImageBytes = reader.ReadBytes(file.ContentLength);

                Store_Registration adm = new Store_Registration();
                adm.StoreEmail         = model.StoreEmail;
                adm.Store_Name         = model.Store_Name;
                adm.Phone              = model.Phone;
                adm.License_Number     = model.License_Number;
                adm.License_Image_Copy = ImageBytes;
                adm.Address            = model.Address;
                adm.Pan_Number         = model.Pan_Number;
                adm.Percentage         = model.Percentage;
                adm.Status             = model.Status;
                adm.Owner_Email        = model.Owner_Email;
                adm.Status             = model.Status;
                flag = IObjRep.AddStore(adm);
            }
            return(flag);
        }
Пример #2
0
 public Store_Registration storeRegister(Store_Registration storeRegister)
 {
     using (MSMSEntities db = new MSMSEntities())
     {
         db.Store_Registration.Add(storeRegister);
         db.SaveChanges();
     }
     return(storeRegister);
 }
Пример #3
0
        //2.4)This method is used to add new OA to database
        public bool AddStore(Store_Registration adm)
        {
            bool flag = false;
            int  i    = 0;

            using (MSMSDBEntities db = new MSMSDBEntities())
            {
                db.Store_Registration.Add(adm);
                i += db.SaveChanges();
                if (i > 0)
                {
                    flag = true;
                }
            }
            return(flag);
        }
Пример #4
0
 public ActionResult StoreAdd(Store_Registration store, string txtOwnerEmail, string ddlDepId, Owner_Registration owner, string Register, HttpPostedFileBase Image)
 {
     if ("Register" == "Register")
     {
         store.License_Image_Copy = new byte[Image.ContentLength];
         Image.InputStream.Read(store.License_Image_Copy, 0, Image.ContentLength);
         if (txtOwnerEmail == null)
         {
             ObjBal.UpdateOwner(owner, ddlDepId);
         }
         else
         {
             ObjBal.UpdateOwner(owner, txtOwnerEmail);
         }
         ObjBal.storeRegister(store);
     }
     return(View());
 }
Пример #5
0
 public Store_Registration storeRegister(Store_Registration storeRegister)
 {
     return(Iobj.storeRegister(storeRegister));
 }
Пример #6
0
 public Store_Registration StoreUpdate(Store_Registration store)
 {
     throw new NotImplementedException();
 }
Пример #7
0
 public ActionResult StoreAdd(Store_Registration store, string txtOwnerEmail, string ddlDepId)
 {
     return(View());
 }