Esempio n. 1
0
 private void supplierSavebutton_Click(object sender, EventArgs e)
 {
     Supplier aSupplier=new Supplier();
     aSupplier.Name = supplierNametextBox.Text;
       //  replace(Request.QueryString(test), "'", "''")
        // aSupplier.ContactInformation = contactInformationtextBox.Text;
     aSupplier.ContactInformation = contactInformationtextBox.Text.Replace("'", "''");
     if (supplierNametextBox.Text.Length!=0 && contactInformationtextBox.Text.Length!=0)
     {
         SupplierBLL aBll = new SupplierBLL();
         bool check = aBll.CheckExit(aSupplier.Name);
         if (!check)
         {
             actionlabel.Visible = true;
             actionlabel.Text = aBll.InsertSupplier(aSupplier);
             if (actionlabel.Text != "Please Check Your Input")
             {
                 contactInformationtextBox.Clear();
                 supplierNametextBox.Clear();
             }
         }
         else MessageBox.Show("Supplier Already Exit");
     } else
     {
         actionlabel.Visible = true;
         actionlabel.Text = "Please Check Your Input";
     }
 }
Esempio n. 2
0
        public InventoryPurchaseReport()
        {
            InitializeComponent();
            Invisible();
            label7.Visible = false;
            label9.Visible = false;
            label11.Visible = false;
            label13.Visible = false;
            receiveSumLabel.Visible = false;
            totalSaleslabel.Visible = false;
            totalReturnlabel.Visible = false;
            totalBalancelabel.Visible = false;
            InventoryCategoryBLL aBlll = new InventoryCategoryBLL();
            List<InventoryCategory> aaList = new List<InventoryCategory>();
            aaList = aBlll.GetAllCategory();
            categoryNameComboBox.DataSource = aaList;
            categoryNameComboBox.DisplayMember = "CategoryName";
            categoryNameComboBox.ValueMember = "CategoryId";

            //find out supplier
            SupplierBLL aSupplierBll = new SupplierBLL();
            List<Supplier> aSuppliers = new List<Supplier>();
            aSuppliers = aSupplierBll.GetAllSupplier();
            supplierNamecomboBox.DataSource = aSuppliers;
            supplierNamecomboBox.DisplayMember = "Name";
            supplierNamecomboBox.ValueMember = "SupplierId";
        }
 public FormRegisterProduct()
 {
     InitializeComponent();
     _productBLL  = new ProductBLL();
     _suppliers   = new List <Supplier>();
     _supplierBLL = new SupplierBLL();
 }
Esempio n. 4
0
        string supplierIDSearch;            //存放查询的ID值

        public Frm_Supplier()
        {
            InitializeComponent();
            supplierBLL = new SupplierBLL();
            s           = new Supplier();
            BindDateGridView();
        }
        /// <summary>
        /// 同步供应商基础数据
        /// </summary>
        /// <param name="sapSupplierQuotaInfos"></param>
        /// <param name="loginUser"></param>
        private static string GetSyncSupplierSql(List <SapSupplierQuotaInfo> sapSupplierQuotaInfos, string loginUser)
        {
            StringBuilder @string = new StringBuilder();
            ///获取业务表中要变更的数据集合,准备对比
            List <SupplierInfo> supplierInfos = new SupplierBLL().GetListForInterfaceDataSync(sapSupplierQuotaInfos.Select(d => d.Lifnr).ToList());

            ///
            foreach (var sapSupplierQuotaInfo in sapSupplierQuotaInfos)
            {
                SupplierInfo supplierInfo = supplierInfos.FirstOrDefault(d => d.SupplierNum == sapSupplierQuotaInfo.Lifnr);
                if (supplierInfo == null)
                {
                    supplierInfo              = new SupplierInfo();
                    supplierInfo.Fid          = Guid.NewGuid();
                    supplierInfo.SupplierNum  = sapSupplierQuotaInfo.Lifnr;
                    supplierInfo.SupplierName = sapSupplierQuotaInfo.SupplierName;
                    supplierInfo.SupplierType = (int)SupplierTypeConstants.MaterialSupplier;
                    supplierInfo.CreateUser   = loginUser;
                    supplierInfo.CreateDate   = DateTime.Now;
                    @string.AppendLine(SupplierDAL.GetInsertSql(supplierInfo));
                    supplierInfos.Add(supplierInfo);
                    continue;
                }
                ///更新
                @string.AppendLine("update [LES].[TM_BAS_SUPPLIER] " +
                                   "set [SUPPLIER_NAME] = N'" + sapSupplierQuotaInfo.SupplierName + "'," +
                                   "[MODIFY_USER] = N'" + loginUser + "'," +
                                   "[MODIFY_DATE] = GETDATE() " +
                                   "where [FID] = N'" + supplierInfo.Fid.GetValueOrDefault() + "';");
            }
            return(@string.ToString());
        }
Esempio n. 6
0
        // GET: Admin/Supplier
        public ActionResult Index()
        {
            SupplierBLL     objSupplierBLL = new SupplierBLL();
            List <Supplier> SupplierList   = objSupplierBLL.GetAllSupplier();

            return(View(SupplierList));
        }
Esempio n. 7
0
        public InventoryPurchaseReport()
        {
            InitializeComponent();
            Invisible();
            label7.Visible            = false;
            label9.Visible            = false;
            label11.Visible           = false;
            label13.Visible           = false;
            receiveSumLabel.Visible   = false;
            totalSaleslabel.Visible   = false;
            totalReturnlabel.Visible  = false;
            totalBalancelabel.Visible = false;
            InventoryCategoryBLL     aBlll  = new InventoryCategoryBLL();
            List <InventoryCategory> aaList = new List <InventoryCategory>();

            aaList = aBlll.GetAllCategory();
            categoryNameComboBox.DataSource    = aaList;
            categoryNameComboBox.DisplayMember = "CategoryName";
            categoryNameComboBox.ValueMember   = "CategoryId";


            //find out supplier
            SupplierBLL     aSupplierBll = new SupplierBLL();
            List <Supplier> aSuppliers   = new List <Supplier>();

            aSuppliers = aSupplierBll.GetAllSupplier();
            supplierNamecomboBox.DataSource    = aSuppliers;
            supplierNamecomboBox.DisplayMember = "Name";
            supplierNamecomboBox.ValueMember   = "SupplierId";
        }
Esempio n. 8
0
        private void printReportbutton_Click(object sender, EventArgs e)
        {
            SupplierBLL     aSupplierBll     = new SupplierBLL();
            List <Supplier> aSupplierReports = new List <Supplier>();

            aSupplierReports = (List <Supplier>)supplierdataGridView.DataSource;
            if (aSupplierReports == null)
            {
                MessageBox.Show("No data Available Into GridView");
                return;
            }

            int           printlenght = aSupplierReports.Count;
            PrintDocument doc         = new TextDocument(aSupplierBll.SupplierPaymentReportPrint(aSupplierReports), printlenght);

            printReportLogoType = 1;
            doc.PrintPage      += this.Doc_PrintPage;


            doc.DefaultPageSettings.Landscape = true;
            PrintDialog dlgSettings = new PrintDialog();

            dlgSettings.Document    = doc;
            dlgSettings.UseEXDialog = true;
            if (dlgSettings.ShowDialog() == DialogResult.OK)
            {
                doc.Print();
            }
        }
Esempio n. 9
0
        private void supplierSavebutton_Click(object sender, EventArgs e)
        {
            Supplier aSupplier = new Supplier();

            aSupplier.Name = supplierNametextBox.Text;
            //  replace(Request.QueryString(test), "'", "''")
            // aSupplier.ContactInformation = contactInformationtextBox.Text;
            aSupplier.ContactInformation = contactInformationtextBox.Text.Replace("'", "''");
            if (supplierNametextBox.Text.Length != 0 && contactInformationtextBox.Text.Length != 0)
            {
                SupplierBLL aBll  = new SupplierBLL();
                bool        check = aBll.CheckExit(aSupplier.Name);
                if (!check)
                {
                    actionlabel.Visible = true;
                    actionlabel.Text    = aBll.InsertSupplier(aSupplier);
                    if (actionlabel.Text != "Please Check Your Input")
                    {
                        contactInformationtextBox.Clear();
                        supplierNametextBox.Clear();
                    }
                }
                else
                {
                    MessageBox.Show("Supplier Already Exit");
                }
            }
            else
            {
                actionlabel.Visible = true;
                actionlabel.Text    = "Please Check Your Input";
            }
        }
Esempio n. 10
0
        public ActionResult Get(int id)
        {
            if (id <= 0)
            {
                return(Json(new ResultModel(string.Format("{0}不存在", this.ModelName))));
            }

            SupplierBLL dal    = new SupplierBLL();
            ResultModel result = dal.Get(id);

            if (result.ResultStatus != 0)
            {
                return(Json(result));
            }

            object rtnObj = result.ReturnValue;

            if (rtnObj == null)
            {
                return(Json(new ResultModel(string.Format("{0}不存在", this.ModelName))));
            }

            result.ResultStatus = 0;
            result.Message      = string.Format("{0}获取成功", this.ModelName);
            result.ReturnValue  = Newtonsoft.Json.JsonConvert.SerializeObject(rtnObj);
            return(Json(result));
        }
Esempio n. 11
0
        public dynamic GetSupplierList()
        {
            SupplierBLL           bll  = new SupplierBLL();
            List <S_SupplierInfo> list = bll.GetSupplierList();

            return(list);
        }
Esempio n. 12
0
        public ActionResult Delete(int id)
        {
            SupplierBLL objSupplierBLL = new SupplierBLL();
            var         supplier       = objSupplierBLL.GetSupplier(id);

            return(View(supplier));
        }
Esempio n. 13
0
        public ActionResult Edit(int id)
        {
            SupplierBLL objSupplierBLL = new SupplierBLL();
            var         supplier       = objSupplierBLL.GetAllSupplierById(id);

            return(View(supplier));
        }
Esempio n. 14
0
        public dynamic GetSearchSupplierList()
        {
            string                name = Fun.Query("name");
            SupplierBLL           bll  = new SupplierBLL();
            List <S_SupplierInfo> list = bll.GetSearchSupplierList(name);

            return(list);
        }
Esempio n. 15
0
        public dynamic GetSupplier()
        {
            int            id  = Fun.Query("id", 0);
            SupplierBLL    bll = new SupplierBLL();
            S_SupplierInfo s   = bll.GetSupplier(id);

            return(s);
        }
Esempio n. 16
0
 private void frmInput_Load(object sender, EventArgs e)
 {
     inputBLL    = new InputBLL();
     supplierBLL = new SupplierBLL();
     inputObj    = new Input();
     inputObjSea = new Input();
     // Load data for supplier
     LoadSuppliers();
 }
Esempio n. 17
0
 public ActionResult DeleteMeasurement(int id)
 {
     if (ModelState.IsValid)
     {
         SupplierBLL objSupplierBLL = new SupplierBLL();
         objSupplierBLL.DeleteSupplier(id);
     }
     return(RedirectToAction("Index", "Supplier"));
 }
Esempio n. 18
0
        private void AddProductForm_Load(object sender, EventArgs e)
        {
            comboBox1.DataSource    = CategoryBLL.GetCategory();
            comboBox1.DisplayMember = "CategoryName";
            comboBox1.ValueMember   = "CategoryID";

            comboBox2.DataSource    = SupplierBLL.GetSupplier();
            comboBox2.DisplayMember = "CompanyName";
            comboBox2.ValueMember   = "SupplierID";
        }
Esempio n. 19
0
        public ActionResult Edit(Supplier objSupplier)
        {
            if (ModelState.IsValid)
            {
                SupplierBLL objSupplierBLL = new SupplierBLL();

                objSupplierBLL.UpdateSupplier(objSupplier);
            }
            return(RedirectToAction("Index", "Supplier"));
        }
Esempio n. 20
0
 public FormRegisterIncome()
 {
     InitializeComponent();
     supplier     = new Supplier();
     _incomeBLL   = new IncomeBLL();
     _product     = new Product();
     _incomeItems = new List <IncomeItem>();
     _supplierBLL = new SupplierBLL();
     _productBLL  = new ProductBLL();
     _incomesGrid = new List <IncomeGrid>();
 }
Esempio n. 21
0
 public SupplierInformationForm()
 {
     InitializeComponent();
     //find out supplier
     SupplierBLL aSupplierBll = new SupplierBLL();
     List<Supplier> aSuppliers = new List<Supplier>();
     aSuppliers = aSupplierBll.GetAllSupplier();
     supplierNamecomboBox.DataSource = aSuppliers;
     supplierNamecomboBox.DisplayMember = "Name";
     supplierNamecomboBox.ValueMember = "SupplierId";
 }
Esempio n. 22
0
        public SupplierInformationForm()
        {
            InitializeComponent();
            //find out supplier
            SupplierBLL     aSupplierBll = new SupplierBLL();
            List <Supplier> aSuppliers   = new List <Supplier>();

            aSuppliers = aSupplierBll.GetAllSupplier();
            supplierNamecomboBox.DataSource    = aSuppliers;
            supplierNamecomboBox.DisplayMember = "Name";
            supplierNamecomboBox.ValueMember   = "SupplierId";
        }
Esempio n. 23
0
        // GET: Purchase/Purchase
        public ActionResult Index()
        {
            SupplierBLL     objSupplierBLL = new SupplierBLL();
            List <Supplier> SupplierList   = objSupplierBLL.GetAllSupplier();

            ViewBag.supplierList = SupplierList;
            ProductBLL     objProductBll = new ProductBLL();
            List <Product> ProductList   = objProductBll.GetAllProduct();

            ViewBag.productList = ProductList;
            return(View());
        }
 public ActionResult Delete(string id)
 {
     try
     {
         var result = new SupplierBLL().DeleteSupplier(id);
         return(JsonContentHelper.GetJsonContent(result));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 25
0
        public Frm_InStockCheck()
        {
            InitializeComponent();
            //绑定供应商名称
            List <Supplier> supplierList  = new SupplierBLL().GetList();
            var             idAndNameList = from s in supplierList select new { s.SupplierID, s.SupplierContact.Name };

            cbSupplier.DataSource    = idAndNameList.ToList();
            cbSupplier.DisplayMember = "Name";
            cbSupplier.ValueMember   = "SupplierID";
            txtMemo.Enabled          = true;
        }
 public ActionResult Edit(WebSupplier webSupplier)
 {
     try
     {
         var result = new SupplierBLL().UpdateSupplier(webSupplier);
         return(JsonContentHelper.GetJsonContent(result));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 27
0
        public BasePurchaseForm()
        {
            InitializeComponent();
            supplierBLL             = new SupplierBLL();
            purchaseBLL             = new PurchaseBLL();
            purchaseDetails         = new List <PurchaseDetail>();
            purchase                = new Purchase();
            selected_PurchaseDetail = new PurchaseDetail();

            dtBeginDate.Value = DateTime.Now;
            dtEndDate.Value   = DateTime.Now.AddDays(1);
        }
Esempio n. 28
0
        public SupplierPaymentReportForm()
        {
            InitializeComponent();
            //find out supplier
            SupplierBLL aSupplierBll = new SupplierBLL();
            List<Supplier> aSuppliers = new List<Supplier>();
            aSuppliers = aSupplierBll.GetAllSupplier();
            supplierNamecomboBox.DataSource = aSuppliers;
            supplierNamecomboBox.DisplayMember = "Name";
            supplierNamecomboBox.ValueMember = "SupplierId";

            BookedPaymentTypeCombobox();
        }
Esempio n. 29
0
 public ResponseSupplierDelete SupplierDelete([FromBody] RequestSupplierDelete request)
 {
     try
     {
         SupplierBLL bll = new SupplierBLL();
         return(bll.SupplierDelete(request));
     }
     catch (Exception ex)
     {
         throw new HttpResponseException(
                   Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
Esempio n. 30
0
        public InventoryPurchaseForm()
        {
            InitializeComponent();
            //  this.AcceptButton=savePurchasebutton;
            purchaseActionlabel.Visible = false;
            //Find out category
            List <InventoryCategory> aaList = new List <InventoryCategory>();
            InventoryCategoryBLL     aBll   = new InventoryCategoryBLL();

            aaList = aBll.GetAllCategory();
            categoryNamecomboBox.DataSource    = aaList;
            categoryNamecomboBox.DisplayMember = "CategoryName";
            categoryNamecomboBox.ValueMember   = "CategoryId";



            //findout item
            InventoryItemBLL     aaBll = new InventoryItemBLL();
            List <InventoryItem> aList = new List <InventoryItem>();
            Int32 category             = Convert.ToInt32(categoryNamecomboBox.SelectedValue);

            aList = aaBll.GetItemByCategory(category);
            itemNamecomboBox.DataSource    = aList;
            itemNamecomboBox.DisplayMember = "ItemName";
            itemNamecomboBox.ValueMember   = "ItemId";

            //find out unit
            //int unitId = aaList[categoryNamecomboBox.SelectedIndex].UnitId;
            //UnitCreateBLL aCreateBll = new UnitCreateBLL();
            //Unit aUnit = new Unit();
            //aUnit = aCreateBll.GetUnitByUnitId(unitId);
            try
            {
                unittypelabel.Text = aList[itemNamecomboBox.SelectedIndex].UnitName;
            }
            catch (Exception)
            {
            }


            //find out supplier
            SupplierBLL     aSupplierBll = new SupplierBLL();
            List <Supplier> aSuppliers   = new List <Supplier>();

            aSuppliers = aSupplierBll.GetAllSupplier();
            supplierNamecomboBox.DataSource    = aSuppliers;
            supplierNamecomboBox.DisplayMember = "Name";
            supplierNamecomboBox.ValueMember   = "SupplierId";
            dueOradvancelabel.Text             = aSupplierBll.GetDueOrAdvance(aSuppliers, Convert.ToInt32(supplierNamecomboBox.SelectedValue));
            BookedPaymentTypeCombobox();
        }
Esempio n. 31
0
        public JsonResult GetSupplierNameIsExist(string supplierName)
        {
            SupplierBLL objSupplierBLL = new SupplierBLL();
            bool        exsits         = objSupplierBLL.GetSupplierNameIsExist(supplierName);

            if (exsits)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(true, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 32
0
        private void supplierNamecomboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            SupplierBLL     aSupplierBll = new SupplierBLL();
            List <Supplier> aSuppliers   = new List <Supplier>();

            aSuppliers = aSupplierBll.GetAllSupplier();
            try
            {
                dueOradvancelabel.Text = aSupplierBll.GetDueOrAdvance(aSuppliers, Convert.ToInt32(supplierNamecomboBox.SelectedValue));
            }
            catch
            {
            }
        }
Esempio n. 33
0
        public void GetSupplierTest()
        {
            SupplierBLL     target   = new SupplierBLL(); // TODO: Initialize to an appropriate value
            List <Supplier> expected = null;              // TODO: Initialize to an appropriate value
            List <Supplier> actual;
            int             count;
            Supplier        s = new Supplier {
                DUNS = "66"
            };

            actual = target.QuerySupplierByPage(s, 6, 2, out count);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Esempio n. 34
0
        public dynamic DeleteSupplier()
        {
            int         id  = Fun.Form("id", 0);
            SupplierBLL bll = new SupplierBLL();

            if (!bll.DeleteSupplier(id))
            {
                return("失败");
            }
            else
            {
                return("成功");
            }
        }
Esempio n. 35
0
 public SupplierPayment()
 {
     InitializeComponent();
        // this.AcceptButton = savePaymentbutton;
     //find out supplier
     purchaseActionlabel.Visible = false;
     SupplierBLL aSupplierBll = new SupplierBLL();
     List<Supplier> aSuppliers = new List<Supplier>();
     aSuppliers = aSupplierBll.GetAllSupplier();
     supplierNamecomboBox.DataSource = aSuppliers;
     supplierNamecomboBox.DisplayMember = "Name";
     supplierNamecomboBox.ValueMember = "SupplierId";
     dueOradvancelabel.Text = aSupplierBll.GetDueOrAdvance(aSuppliers, Convert.ToInt32(supplierNamecomboBox.SelectedValue));
     BookedPaymentTypeCombobox();
 }
Esempio n. 36
0
        public InventoryPurchaseForm()
        {
            InitializeComponent();
              //  this.AcceptButton=savePurchasebutton;
            purchaseActionlabel.Visible = false;
            //Find out category
            List<InventoryCategory> aaList=new List<InventoryCategory>();
            InventoryCategoryBLL aBll=new InventoryCategoryBLL();
            aaList = aBll.GetAllCategory();
            categoryNamecomboBox.DataSource = aaList;
            categoryNamecomboBox.DisplayMember = "CategoryName";
            categoryNamecomboBox.ValueMember = "CategoryId";

            //findout item
            InventoryItemBLL aaBll = new InventoryItemBLL();
            List<InventoryItem> aList = new List<InventoryItem>();
            Int32 category = Convert.ToInt32(categoryNamecomboBox.SelectedValue);
            aList = aaBll.GetItemByCategory(category);
            itemNamecomboBox.DataSource = aList;
            itemNamecomboBox.DisplayMember = "ItemName";
            itemNamecomboBox.ValueMember = "ItemId";

            //find out unit
            //int unitId = aaList[categoryNamecomboBox.SelectedIndex].UnitId;
            //UnitCreateBLL aCreateBll = new UnitCreateBLL();
            //Unit aUnit = new Unit();
            //aUnit = aCreateBll.GetUnitByUnitId(unitId);
            try
            {
                unittypelabel.Text = aList[itemNamecomboBox.SelectedIndex].UnitName;
            }
            catch (Exception)
            {

            }

            //find out supplier
            SupplierBLL aSupplierBll=new SupplierBLL();
            List<Supplier>aSuppliers=new List<Supplier>();
            aSuppliers = aSupplierBll.GetAllSupplier();
            supplierNamecomboBox.DataSource = aSuppliers;
            supplierNamecomboBox.DisplayMember = "Name";
            supplierNamecomboBox.ValueMember = "SupplierId";
            dueOradvancelabel.Text = aSupplierBll.GetDueOrAdvance(aSuppliers,Convert.ToInt32(supplierNamecomboBox.SelectedValue));
            BookedPaymentTypeCombobox();
        }
Esempio n. 37
0
        private void savePaymentbutton_Click(object sender, System.EventArgs e)
        {
            if (paidPricetextBox.Text.Length > 0)
            {
                try
                {
                   // Supplier aSupplier = (Supplier) supplierNamecomboBox.SelectedItem;
                    if (Convert.ToDouble(paidPricetextBox.Text) > 0)
                    {
                        SupplierBLL aSupplierBll = new SupplierBLL();
                        Supplier aSupplier =
                            aSupplierBll.GetSupplierByid(Convert.ToInt32(supplierNamecomboBox.SelectedValue));

                        Supplier aasSupplier = new Supplier();
                        aasSupplier.SupplierId = aSupplier.SupplierId;
                        aasSupplier.TotalAmount = aSupplier.TotalAmount;
                        aasSupplier.PaidAmount = Convert.ToDouble(paidPricetextBox.Text);
                        aasSupplier.PaymentType = (string)paymentTypecomboBox.SelectedItem;
                        aSupplierBll.InsertIntosupplier_payment_reportForSupplierPaymentTrack(aasSupplier);
                        aSupplier.PaidAmount += Convert.ToDouble(paidPricetextBox.Text);
                        aSupplierBll.UpdateSupplierForPurchase(aSupplier);
                        purchaseActionlabel.Visible = true;
                        purchaseActionlabel.Text = "Payment Successfully";
                        paidPricetextBox.Clear();
                    }
                    else MessageBox.Show("You cannot put zero balance!");

                }
                catch (Exception ex)
                {

                   // throw new Exception("Please check input format",ex);
                    MessageBox.Show("Please check input format");
                }
            }
            else MessageBox.Show("Please Check Paid Amount, May be Empty");
        }
Esempio n. 38
0
        private void printReportbutton_Click(object sender, EventArgs e)
        {
            SupplierBLL aSupplierBll = new SupplierBLL();
            List<Supplier> aSupplierReports = new List<Supplier>();
            aSupplierReports = (List<Supplier>)supplierdataGridView.DataSource;
            if(aSupplierReports==null)
            {
                MessageBox.Show("No data Available Into GridView");
                return;
            }

            int printlenght = aSupplierReports.Count;
            PrintDocument doc = new TextDocument(aSupplierBll.SupplierPaymentReportPrint(aSupplierReports), printlenght);

            printReportLogoType = 1;
            doc.PrintPage += this.Doc_PrintPage;

            doc.DefaultPageSettings.Landscape = true;
            PrintDialog dlgSettings = new PrintDialog();
            dlgSettings.Document = doc;
            dlgSettings.UseEXDialog = true;
            if (dlgSettings.ShowDialog() == DialogResult.OK)
            {
                doc.Print();
            }
        }
Esempio n. 39
0
        private void supplierNamecomboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            SupplierBLL aSupplierBll = new SupplierBLL();
            List<Supplier> aSuppliers = new List<Supplier>();
            aSuppliers = aSupplierBll.GetAllSupplier();
            try
            {
                dueOradvancelabel.Text = aSupplierBll.GetDueOrAdvance(aSuppliers, Convert.ToInt32(supplierNamecomboBox.SelectedValue));
            }
            catch
            {

            }
        }
Esempio n. 40
0
        private void savePurchasebutton_Click(object sender, EventArgs e)
        {
            try
            {

                if (expiredateTimePicker.Value.Date == DateTime.Now.Date)
                {
                    DialogResult result = MessageBox.Show("Do you want to Empty Expire Date?", "Confirmation",
                                                          MessageBoxButtons.YesNo);
                    if (result == DialogResult.Yes)
                    {

                    }
                    else if (result == DialogResult.No)
                    {
                        return;
                    }

                }

                if (pricetextBox.Text.Length != 0 && paidPricetextBox.Text.Length != 0 && quantitytextBox.Text.Length != 0)
                {
                    InventoryPurchase aInventoryPurchase = new InventoryPurchase();
                    InventoryCategory aCategory = new InventoryCategory();
                    InventoryItem aItem = new InventoryItem();
                    Supplier aSupplier = new Supplier();
                    Supplier aaSupplier = new Supplier();
                    Unit aUnit = new Unit();

                    //Add for purchase record
                    aCategory = (InventoryCategory) categoryNamecomboBox.Items[categoryNamecomboBox.SelectedIndex];

                    SupplierBLL aSupplierBll = new SupplierBLL();
                    aSupplier = aSupplierBll.GetSupplierByid(Convert.ToInt32(supplierNamecomboBox.SelectedValue));
                   // aSupplier = (Supplier) supplierNamecomboBox.Items[supplierNamecomboBox.SelectedIndex];
                    if (aSupplier.PaidAmount > aSupplier.TotalAmount)
                    {
                        aSupplier.AdvanceAmount = aSupplier.PaidAmount - aSupplier.TotalAmount;
                    }
                    else aSupplier.DueAmount = aSupplier.TotalAmount - aSupplier.PaidAmount;

                    aItem = (InventoryItem) itemNamecomboBox.Items[itemNamecomboBox.SelectedIndex];
                    aInventoryPurchase.Quantity = Convert.ToDouble(quantitytextBox.Text);
                    aInventoryPurchase.Price = Convert.ToDouble(pricetextBox.Text);
                    aInventoryPurchase.Date = DateTime.Now;
                    aInventoryPurchase.Category = aCategory;
                    aInventoryPurchase.Item = aItem;
                    aaSupplier.PaidAmount = Convert.ToDouble(paidPricetextBox.Text);
                    aInventoryPurchase.Supplier = aaSupplier;
                    if (((aSupplier.DueAmount + Convert.ToDouble(pricetextBox.Text) -
                          (Convert.ToDouble(paidPricetextBox.Text) + aSupplier.AdvanceAmount))) >= 0)
                        aInventoryPurchase.Supplier.DueAmount = aSupplier.DueAmount +
                                                                Convert.ToDouble(pricetextBox.Text) -
                                                                (Convert.ToDouble(paidPricetextBox.Text) +
                                                                 aSupplier.AdvanceAmount);
                    else aInventoryPurchase.Supplier.DueAmount = 0.0;
                    if (((Convert.ToDouble(paidPricetextBox.Text) + aSupplier.AdvanceAmount) -
                         (aSupplier.DueAmount + Convert.ToDouble(pricetextBox.Text))) >= 0)
                    {
                        aInventoryPurchase.Supplier.AdvanceAmount = (Convert.ToDouble(paidPricetextBox.Text) +
                                                                     aSupplier.AdvanceAmount) -
                                                                    (aSupplier.DueAmount +
                                                                     Convert.ToDouble(pricetextBox.Text));
                    }
                    else aInventoryPurchase.Supplier.AdvanceAmount = 0.0;
                    aInventoryPurchase.Supplier.Name = aSupplier.Name;
                    aInventoryPurchase.Supplier.SupplierId = aSupplier.SupplierId;
                    aUnit.UnitName = unittypelabel.Text;
                    aInventoryPurchase.Unit = aUnit;
                    CUserInfo aUserInfo= new CUserInfo();
                    aUserInfo.UserName= RMSGlobal.LogInUserName;
                    aInventoryPurchase.PaymentType= paymentTypecomboBox.SelectedItem.ToString();
                    aInventoryPurchase.CUserInfo= aUserInfo;
                    if (expiredateTimePicker.Value.Date == DateTime.Now.Date)
                    {

                    }
                    else
                    {
                        aInventoryPurchase.ExpireDate = expiredateTimePicker.Value.Date;
                    }

                    string res = string.Empty;

                    InventoryPurchaseBLL aInventoryPurchaseBll = new InventoryPurchaseBLL();
                    res = aInventoryPurchaseBll.InsertPurchase(aInventoryPurchase);

                    if(res=="Purchase Insert Sucessfully")
                    {
                        //Add for Supplier Update
                        aSupplier.TotalAmount += Convert.ToDouble(pricetextBox.Text);
                        aSupplier.PaidAmount += Convert.ToDouble(paidPricetextBox.Text);

                        aSupplierBll.UpdateSupplierForPurchase(aSupplier);

                        //Add for Supplier payment report
                        Supplier paymentSupplier=new Supplier();
                        paymentSupplier.PaidAmount = Convert.ToDouble(paidPricetextBox.Text);
                        paymentSupplier.TotalAmount = Convert.ToDouble(pricetextBox.Text);
                        paymentSupplier.SupplierId = aSupplier.SupplierId;
                        paymentSupplier.PaymentType = paymentTypecomboBox.SelectedItem.ToString();
                        aSupplierBll.InsertIntosupplier_payment_reportForSupplierPaymentTrack(paymentSupplier);

                        //Add for stock update
                        Stock aStock=new Stock();
                        aStock.Category = aCategory;
                        aStock.Item = aItem;
                        aStock.Unit = aUnit;
                        aStock.Stocks = Convert.ToDouble(quantitytextBox.Text);
                        aStock.UnitPrice = Convert.ToDouble(pricetextBox.Text)/aStock.Stocks;
                        StockBLL aStockBll=new StockBLL();
                        aStockBll.InsertStockOrUpdate(aStock);

                        purchaseActionlabel.Visible = true;
                        purchaseActionlabel.Text = res;
                        Clear();
                    }else
                    {
                        purchaseActionlabel.Visible = true;
                        purchaseActionlabel.Text = res;
                    }

                }else
                {
                    purchaseActionlabel.Visible = true;
                    purchaseActionlabel.Text = "Please Check Your Input";
                }

            }
            catch
            {
                MessageBox.Show("Try Again May Be Your Given Input Format Not Correct Please Given Again ");

            }
        }
Esempio n. 41
0
        private void showButton_Click(object sender, System.EventArgs e)
        {
            SupplierBLL aSupplierBll=new SupplierBLL();
            List<Supplier>aList=new List<Supplier>();
            if(viewAllsuppliercheckBox.Checked)
            {
                aList = aSupplierBll.GetAllSupplier();
                supplierdataGridView.DataSource = aList;
            }
            else
            {
                Supplier aSupplier=new Supplier();
                aSupplier = aSupplierBll.GetSupplierByid(Convert.ToInt32(supplierNamecomboBox.SelectedValue));
                aList = new List<Supplier> {aSupplier};
                supplierdataGridView.DataSource = aList;

            }
        }