Exemplo n.º 1
0
 /// <summary>
 /// Takes the specified budget source property.
 /// </summary>
 /// <param name="vendor">The vendor.</param>
 /// <returns></returns>
 private object[] Take(VendorEntity vendor)
 {
     return(new object[]
     {
         "@VendorID", vendor.VendorId
         , "@VendorCode", vendor.VendorCode
         , "@VendorName", vendor.VendorName
         , "@Address", vendor.Address
         , "@ContactName", vendor.ContactName
         , "@ContactRegency", vendor.ContactRegency
         , "@Phone", vendor.Phone
         , "@Mobile", vendor.Mobile
         , "@Fax", vendor.Fax
         , "@Email", vendor.Email
         , "@TaxCode", vendor.TaxCode
         , "@Website", vendor.Website
         , "@Province", vendor.Province
         , "@City", vendor.City
         , "@ZipCode", vendor.ZipCode
         , "@Area", vendor.Area
         , "@Country", vendor.Country
         , "@BankNumber", vendor.BankNumber
         , "@BankName", vendor.BankName
         , "@BankID", vendor.BankId
         , "@IsActive", vendor.IsActive
     });
 }
Exemplo n.º 2
0
        /// <summary>
        /// Deletes the specified object.
        /// </summary>
        /// <param name="vendorEntity">The vendor entity.</param>
        /// <returns></returns>
        public string DeleteVendor(VendorEntity vendorEntity)
        {
            const string sql = @"uspDelete_Vendor";

            object[] parms = { "@VendorID", vendorEntity.VendorId };
            return(Db.Delete(sql, true, parms));
        }
Exemplo n.º 3
0
 protected BusinessEntityEntity(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     if (SerializationHelper.Optimization != SerializationOptimization.Fast)
     {
         _businessEntityAddresses = (EntityCollection <BusinessEntityAddressEntity>)info.GetValue("_businessEntityAddresses", typeof(EntityCollection <BusinessEntityAddressEntity>));
         _businessEntityContacts  = (EntityCollection <BusinessEntityContactEntity>)info.GetValue("_businessEntityContacts", typeof(EntityCollection <BusinessEntityContactEntity>));
         _person = (PersonEntity)info.GetValue("_person", typeof(PersonEntity));
         if (_person != null)
         {
             _person.AfterSave += new EventHandler(OnEntityAfterSave);
         }
         _vendor = (VendorEntity)info.GetValue("_vendor", typeof(VendorEntity));
         if (_vendor != null)
         {
             _vendor.AfterSave += new EventHandler(OnEntityAfterSave);
         }
         _store = (StoreEntity)info.GetValue("_store", typeof(StoreEntity));
         if (_store != null)
         {
             _store.AfterSave += new EventHandler(OnEntityAfterSave);
         }
         this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
     }
     // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
     // __LLBLGENPRO_USER_CODE_REGION_END
 }
Exemplo n.º 4
0
        public VendorEntity Get(Guid VendorId)
        {
            Vendor Vendor = vendorRepository.Get(VendorId);

            if (Vendor == null)
            {
                return(null);
            }
            VendorEntity VendorEntity = new VendorEntity(Vendor);

            return(VendorEntity);
        }
Exemplo n.º 5
0
        /// <summary>
        /// AddUpdateVendorDetails
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public CommonResponse AddUpdateVendorDetails(VendorEntity data)
        {
            CommonResponse obj = new CommonResponse();

            try
            {
                var check = db.UnitworkccsTblvendor.Where(m => m.VendorId == data.vendorId && m.IsDeleted == 0).FirstOrDefault();
                if (check == null)
                {
                    UnitworkccsTblvendor UnitworkccsTblvendordet = new UnitworkccsTblvendor();
                    UnitworkccsTblvendordet.Vendor     = data.vendor;
                    UnitworkccsTblvendordet.VendorName = data.vendorName;
                    UnitworkccsTblvendordet.IsDeleted  = 0;
                    UnitworkccsTblvendordet.CreatedOn  = DateTime.Now;
                    UnitworkccsTblvendordet.CreatedBy  = 1;
                    db.UnitworkccsTblvendor.Add(UnitworkccsTblvendordet);
                    db.SaveChanges();

                    obj.isStatus = true;
                    obj.response = ResourceResponse.AddedSuccessMessage;
                }
                else
                {
                    check.Vendor     = data.vendor;
                    check.VendorName = data.vendorName;
                    check.ModifiedBy = 2;
                    check.ModifiedOn = DateTime.Now;
                    db.SaveChanges();

                    obj.isStatus = true;
                    obj.response = ResourceResponse.UpdatedSuccessMessage;
                }
            }
            catch (Exception e)
            {
                log.Error(e); if (e.InnerException != null)
                {
                    log.Error(e.InnerException.ToString());
                }
                obj.isStatus = false;
                obj.response = ResourceResponse.FailureMessage;
            }
            return(obj);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Gets all vendors.
        /// </summary>
        /// <returns>
        /// Get All Vendors
        /// </returns>
        public IEnumerable <VendorEntity> GetAllVendors()
        {
            IList <VendorEntity> result     = new List <VendorEntity>();
            IVendorBL            vendorBL   = new VendorBL();
            List <Vendor>        vendorList = vendorBL.GetAllVendor();

            foreach (Vendor source in vendorList)
            {
                VendorEntity target = new VendorEntity();
                target.VendorID = source.VendorID;
                target.Vendor   = source.Vendor1;
                target.Address  = source.AddressLine1;
                target.City     = source.City;
                target.State    = source.State;
                target.Country  = source.Country;
                result.Add(target);
            }
            return(result);
        }
Exemplo n.º 7
0
        public static IVendor GetVendor(int ID)
        {
            string strExecution = "[mst].[spGetVendor]";
            //List<IVendor> lstVnd = new List<IVendor>();
            IVendor Vnd = null;

            using (DbQuery oDq = new DbQuery(strExecution))
            {
                oDq.AddIntegerParam("@VendorId", ID);
                DataTableReader reader = oDq.GetTableReader();

                while (reader.Read())
                {
                    Vnd = new VendorEntity(reader);
                }
                reader.Close();
            }
            return(Vnd);
        }
Exemplo n.º 8
0
        //private void CheckUserAccess()
        //{
        //    if (!ReferenceEquals(Session[Constants.SESSION_USER_INFO], null))
        //    {
        //        IUser user = (IUser)Session[Constants.SESSION_USER_INFO];

        //        if (ReferenceEquals(user, null) || user.Id == 0)
        //        {
        //            Response.Redirect("~/Login.aspx");
        //        }

        //        if (user.UserRole.Id != (int)UserRole.Admin)
        //        {
        //            Response.Redirect("~/Unauthorized.aspx");
        //        }
        //    }
        //    else
        //    {
        //        Response.Redirect("~/Login.aspx");
        //    }
        //}

        private void LoadData()
        {
            VendorEntity oVendor = (VendorEntity)VendorBLL.GetVendor(Convert.ToInt32(hdnVendorID.Value));

            ddlVendorType.SelectedIndex = ddlVendorType.Items.IndexOf(ddlVendorType.Items.FindByValue(oVendor.VendorType));
            if (ddlVendorType.SelectedItem.Text == "CFS/ICD" || ddlVendorType.SelectedItem.Text == "ICD")
            {
                txtCfsCode.Enabled      = true;
                rfvCfdCode.Enabled      = true;
                ddlTerminalCode.Enabled = true;
            }
            else
            {
                txtCfsCode.Enabled      = false;
                rfvCfdCode.Enabled      = false;
                ddlTerminalCode.Enabled = false;
            }
            ddlLocationID.SelectedIndex = Convert.ToInt32(ddlLocationID.Items.IndexOf(ddlLocationID.Items.FindByValue(oVendor.LocationName)));
            PopulateDropDown((int)Enums.DropDownPopulationFor.TerminalCode, ddlTerminalCode, Convert.ToInt32(ddlLocationID.SelectedValue));

            ddlSalutation.SelectedIndex = Convert.ToInt32(ddlSalutation.Items.IndexOf(ddlSalutation.Items.FindByValue(oVendor.VendorSalutation.ToString())));
            if (ddlTerminalCode.Items.Count > 0)
            {
                ddlTerminalCode.SelectedIndex = Convert.ToInt32(ddlTerminalCode.Items.IndexOf(ddlTerminalCode.Items.FindByValue(oVendor.Terminalid.ToString())));
            }

            txtName.Text     = oVendor.VendorName;
            txtAddress.Text  = oVendor.VendorAddress;
            txtCfsCode.Text  = oVendor.CFSCode;
            TxtTAN.Text      = oVendor.TANo;
            TxtPAN.Text      = oVendor.PAN;
            TxtACNo.Text     = oVendor.AcNo;
            TxtAcType.Text   = oVendor.AcType;
            TxtBankName.Text = oVendor.BankName;
            TxtIEC.Text      = oVendor.IEC;
            TxtEmail.Text    = oVendor.EmailID;
            TxtBIN.Text      = oVendor.BIN;
            TxtMob.Text      = oVendor.Mobile;
            TxtCP.Text       = oVendor.CP;
        }
Exemplo n.º 9
0
        public static List <IVendor> GetVendor(SearchCriteria searchCriteria, int ID)
        {
            string         strExecution = "[mst].[spGetVendor]";
            List <IVendor> lstVnd       = new List <IVendor>();

            //using (DbQuery oDq = new DbQuery(strExecution))
            //{
            //    //=========================================================

            //    oDq.AddIntegerParam("@VendorId", ID);
            //    oDq.AddVarcharParam("@SchName", 100, searchCriteria.LocAbbr);
            //    oDq.AddVarcharParam("@SchLoc", 100, searchCriteria.LocName);
            //    oDq.AddVarcharParam("@SortExpression", 4, searchCriteria.SortExpression);
            //    oDq.AddVarcharParam("@SortDirection", 4, searchCriteria.SortDirection);
            //    DataTable dtAdd = oDq.GetTable();
            //}



            using (DbQuery oDq = new DbQuery(strExecution))
            {
                oDq.AddIntegerParam("@VendorId", ID);
                oDq.AddVarcharParam("@SchName", 100, searchCriteria.LocAbbr);
                oDq.AddVarcharParam("@SchLoc", 100, searchCriteria.LocName);
                oDq.AddVarcharParam("@SortExpression", 10, searchCriteria.SortExpression);
                oDq.AddVarcharParam("@SortDirection", 4, searchCriteria.SortDirection);
                DataTableReader reader = oDq.GetTableReader();

                while (reader.Read())
                {
                    IVendor Vnd = new VendorEntity(reader);
                    lstVnd.Add(Vnd);
                }
                reader.Close();
            }
            return(lstVnd);
        }
Exemplo n.º 10
0
        public IEnumerable <VendorDto> GetVendor(VendorDto vendordto)
        {
            try
            {
                VendorEntity vendorEntity = new VendorEntity
                {
                    login_entity = new LoginEntity
                    {
                        servername = vendordto.login_dto.servername,
                        username   = vendordto.login_dto.username,
                        password   = vendordto.login_dto.password,
                        dBname     = vendordto.login_dto.dBname
                    },
                };

                return(_mapper.Map <IEnumerable <VendorEntity>, IEnumerable <VendorDto> >
                           (_vendorRepository.GetAllVendor(vendorEntity)));
            }
            catch (Exception ex)
            {
                logCentral.Error("PODataAll", ex);
                throw;
            }
        }
 public async Task<IActionResult> AddUpdateVendorDetails(VendorEntity data)
 {
     CommonResponse response = vendor.AddUpdateVendorDetails(data);
     return Ok(response);
 }
Exemplo n.º 12
0
 public VendorEntity Update(VendorEntity VendorEntity, Guid VendorId)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 13
0
 public Vendor(VendorEntity VendorEntity) : base(VendorEntity)
 {
 }
Exemplo n.º 14
0
 public VendorEntity Create(VendorEntity VendorEntity)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 15
0
 public int AddVendor(VendorEntity vendorEntity)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 16
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                oVendorBll    = new VendorBLL();
                oVendorEntity = new VendorEntity();
                //oUserEntity = (UserEntity)Session[Constants.SESSION_USER_INFO]; // This section has been commented temporarily

                oVendorEntity.VendorType       = ddlVendorType.SelectedValue;
                oVendorEntity.LocationID       = Convert.ToInt32(ddlLocationID.SelectedValue);
                oVendorEntity.VendorSalutation = Convert.ToInt32(ddlSalutation.SelectedValue);
                oVendorEntity.VendorName       = txtName.Text.Trim();
                oVendorEntity.VendorAddress    = txtAddress.Text.Trim();
                oVendorEntity.CompanyID        = 1;//Need to populate from data base. This will be the company ID of the currently loggedin user.
                oVendorEntity.VendorActive     = true;
                oVendorEntity.AcNo             = TxtACNo.Text;
                oVendorEntity.AcType           = TxtAcType.Text;
                oVendorEntity.BankName         = TxtBankName.Text;
                oVendorEntity.BIN     = TxtBIN.Text;
                oVendorEntity.EmailID = TxtEmail.Text;
                oVendorEntity.IEC     = TxtIEC.Text;
                oVendorEntity.Mobile  = TxtMob.Text;
                oVendorEntity.TANo    = TxtTAN.Text;
                oVendorEntity.PAN     = TxtPAN.Text;
                oVendorEntity.CP      = TxtCP.Text;


                oVendorEntity.CFSCode = txtCfsCode.Text.Trim();
                if (ddlTerminalCode.Items.Count > 0 && ddlTerminalCode.SelectedIndex > 0)
                {
                    oVendorEntity.Terminalid = Convert.ToInt32(ddlTerminalCode.SelectedValue);
                }

                if (hdnVendorID.Value == "0")           // Insert
                {
                    oVendorEntity.CreatedBy  = _userId; // oUserEntity.Id;
                    oVendorEntity.CreatedOn  = DateTime.Today.Date;
                    oVendorEntity.ModifiedBy = _userId; // oUserEntity.Id;
                    oVendorEntity.ModifiedOn = DateTime.Today.Date;

                    switch (oVendorBll.AddEditVndor(oVendorEntity))
                    {
                    case 0: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00011");
                        break;

                    case 1: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00009");
                        ClearAll();
                        break;
                    }
                }
                else // Update
                {
                    oVendorEntity.VendorId   = Convert.ToInt32(hdnVendorID.Value);
                    oVendorEntity.ModifiedBy = _userId;// oUserEntity.Id;
                    oVendorEntity.ModifiedOn = DateTime.Today.Date;

                    switch (oVendorBll.AddEditVndor(oVendorEntity))
                    {
                    case 0: lblMessage.Text = ResourceManager.GetStringWithoutName("ERR00011");
                        break;

                    case 1: Response.Redirect("~/MasterModule/vendor-list.aspx");
                        break;
                    }
                }
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// Updates the specified object.
        /// </summary>
        /// <param name="vendorEntity">The vendor entity.</param>
        /// <returns></returns>
        public string UpdateVendor(VendorEntity vendorEntity)
        {
            const string sql = @"uspUpdate_Vendor";

            return(Db.Update(sql, true, Take(vendorEntity)));
        }
Exemplo n.º 18
0
        /// <summary>
        /// Inserts the specified object.
        /// </summary>
        /// <param name="vendorEntity">The vendor entity.</param>
        /// <returns></returns>
        public int InsertVendor(VendorEntity vendorEntity)
        {
            const string sql = @"uspInsert_Vendor";

            return(Db.Insert(sql, true, Take(vendorEntity)));
        }
Exemplo n.º 19
0
 public bool UpdateVendor(VendorEntity vendorEntity)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 20
0
 public VendorEntity Create([FromBody] VendorEntity VendorEntity)
 {
     return(VendorService.Create(VendorEntity));
 }
Exemplo n.º 21
0
 public VendorEntity Update(Guid VendorId, [FromBody] VendorEntity VendorEntity)
 {
     return(VendorService.Update(VendorEntity, VendorId));
 }