コード例 #1
0
ファイル: AccountLog.cs プロジェクト: jayjoshi9586/MiniCRM
        public int BranchInsert(Accounts_branch emp)
        {
            this.binding.GetBranchRepository.Insert(emp);
            int inserData = this.binding.Save();

            if (inserData > 0)
            {
                inserData = 1;
                return(inserData);
            }
            else
            {
                inserData = 0;
                return(inserData);
            }
        }
コード例 #2
0
        public IHttpActionResult CreateAccountBranch(CreateAccountBranchBindingModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            Accounts_branch branch = new Accounts_branch()
            {
                Account_branch_id = model.Account_branch_id, Account_email = model.Account_email, Account_phone = model.Account_phone, Account_address = model.Account_address, Account_images = model.Account_images
            };
            int response = _accountLog.BranchInsert(branch);

            if (response == 1)
            {
                return(Ok("Branch has been added"));
            }
            else
            {
                return(BadRequest("There was some error please try again."));
            }
            //var account = new Account() { Account_id = model.Account_id, Account_global_email = model.Account_global_email, Account_name = model.Account_name, Account_brand_logo=model.Account_brand_logo };
            // return Ok();
        }