Beispiel #1
0
        public string SinhMaNhomHang()
        {
            string MaKhachHang, MaTam;

            MaKhachHang      = "";
            MaTam            = "";
            objproduct_group = new PRODUCT_GROUPController().PRODUCT_GROUP_Top1();
            MaTam            = objproduct_group.ProductGroup_ID;
            if (MaTam != "")
            {
                long NumberKhuVuc = long.Parse(MaTam.Substring(2, 6)) + 1;
                MaKhachHang = NumberKhuVuc.ToString();
                for (int i = NumberKhuVuc.ToString().Length; i < 6; i++)
                {
                    MaKhachHang = "0" + MaKhachHang;
                    //MessageBox.Show(MaKhuVuc);
                }
                MaKhachHang = "NH" + MaKhachHang;
            }
            else
            {
                MaKhachHang = "NH000001";
            }
            return(MaKhachHang);
        }
        public string SinhMaKhachHang()
        {
            string MaKhachHang, MaTam;

            MaKhachHang = "";
            MaTam       = "";
            objcustomer = new CUSTOMERController().CUSTOMER_Top1();
            MaTam       = objcustomer.Customer_ID;
            if (MaTam != "")
            {
                long NumberKhuVuc = long.Parse(MaTam.Substring(2, 6)) + 1;
                MaKhachHang = NumberKhuVuc.ToString();
                for (int i = NumberKhuVuc.ToString().Length; i < 6; i++)
                {
                    MaKhachHang = "0" + MaKhachHang;
                    //MessageBox.Show(MaKhuVuc);
                }
                MaKhachHang = "KH" + MaKhachHang;
            }
            else
            {
                MaKhachHang = "KH000001";
            }
            return(MaKhachHang);
        }
        public string SinhMaBoPhan()
        {
            string MaKhachHang, MaTam;

            MaKhachHang   = "";
            MaTam         = "";
            objdepartment = new DEPARTMENTController().DEPARTMENT_Top1();
            MaTam         = objdepartment.Department_ID;
            if (MaTam != "")
            {
                long NumberKhuVuc = long.Parse(MaTam.Substring(2, 6)) + 1;
                MaKhachHang = NumberKhuVuc.ToString();
                for (int i = NumberKhuVuc.ToString().Length; i < 6; i++)
                {
                    MaKhachHang = "0" + MaKhachHang;
                    //MessageBox.Show(MaKhuVuc);
                }
                MaKhachHang = "BP" + MaKhachHang;
            }
            else
            {
                MaKhachHang = "BP000001";
            }
            return(MaKhachHang);
        }
        public string SinhMaKhachHang()
        {
            string MaKhachHang, MaTam;

            MaKhachHang = "";
            MaTam       = "";
            objstock    = new STOCKController().STOCK_Top1();
            MaTam       = objstock.Stock_ID;
            if (MaTam != "")
            {
                long NumberKhuVuc = long.Parse(MaTam.Substring(1, 6)) + 1;
                MaKhachHang = NumberKhuVuc.ToString();
                for (int i = NumberKhuVuc.ToString().Length; i < 6; i++)
                {
                    MaKhachHang = "0" + MaKhachHang;
                    //MessageBox.Show(MaKhuVuc);
                }
                MaKhachHang = "K" + MaKhachHang;
            }
            else
            {
                MaKhachHang = "K000001";
            }
            return(MaKhachHang);
        }
Beispiel #5
0
        public string SinhMaDonVi()
        {
            string MaKhachHang, MaTam;

            MaKhachHang = "";
            MaTam       = "";
            objunit     = new UNITController().UNIT_Top1();
            MaTam       = objunit.Unit_ID;
            if (MaTam != "")
            {
                long NumberKhuVuc = long.Parse(MaTam.Substring(2, 6)) + 1;
                MaKhachHang = NumberKhuVuc.ToString();
                for (int i = NumberKhuVuc.ToString().Length; i < 6; i++)
                {
                    MaKhachHang = "0" + MaKhachHang;
                    //MessageBox.Show(MaKhuVuc);
                }
                MaKhachHang = "DV" + MaKhachHang;
            }
            else
            {
                MaKhachHang = "DV000001";
            }
            return(MaKhachHang);
        }
        public string SinhMaNhanVien()
        {
            string MaKhachHang, MaTam;

            MaKhachHang = "";
            MaTam       = "";
            objemployee = new EMPLOYEEController().Employee_Top1();
            MaTam       = objemployee.Employee_ID;
            if (MaTam != "")
            {
                long NumberKhuVuc = long.Parse(MaTam.Substring(2, 6)) + 1;
                MaKhachHang = NumberKhuVuc.ToString();
                for (int i = NumberKhuVuc.ToString().Length; i < 6; i++)
                {
                    MaKhachHang = "0" + MaKhachHang;
                    //MessageBox.Show(MaKhuVuc);
                }
                MaKhachHang = "NV" + MaKhachHang;
            }
            else
            {
                MaKhachHang = "NV000001";
            }
            return(MaKhachHang);
        }
Beispiel #7
0
        public string SinhMaKhuVuc()
        {
            string MaKhuVuc, MaTam;

            MaKhuVuc = "";
            MaTam    = "";
            objNV    = new CUSTOMER_GROUPController().CUSTOMER_GROUP_Top1();
            MaTam    = objNV.Customer_Group_ID;
            if (MaTam != "")
            {
                long NumberKhuVuc = long.Parse(MaTam.Substring(2, 6)) + 1;
                MaKhuVuc = NumberKhuVuc.ToString();
                for (int i = NumberKhuVuc.ToString().Length; i < 6; i++)
                {
                    MaKhuVuc = "0" + MaKhuVuc;
                    //MessageBox.Show(MaKhuVuc);
                }
                MaKhuVuc = "KV" + MaKhuVuc;
            }
            else
            {
                MaKhuVuc = "KV000001";
            }
            return(MaKhuVuc);
        }
Beispiel #8
0
        public string SinhMaNPP()
        {
            string MaKhachHang, MaTam;

            MaKhachHang = "";
            MaTam       = "";
            objprovider = new PROVIDERController().PROVIDER_Top1();
            MaTam       = objprovider.Customer_ID;
            if (MaTam != "")
            {
                long NumberKhuVuc = long.Parse(MaTam.Substring(3, 6)) + 1;
                MaKhachHang = NumberKhuVuc.ToString();
                for (int i = NumberKhuVuc.ToString().Length; i < 6; i++)
                {
                    MaKhachHang = "0" + MaKhachHang;
                    //MessageBox.Show(MaKhuVuc);
                }
                MaKhachHang = "NPP" + MaKhachHang;
            }
            else
            {
                //MessageBox.Show("ok");
                MaKhachHang = "NPP000001";
            }
            return(MaKhachHang);
        }
        public string SinhMaNhomHang()
        {
            string MaKhachHang, MaTam;

            MaKhachHang = "";
            MaTam       = "";
            MaTam       = MaxNganhHang();
            if (MaTam != "")
            {
                long NumberKhuVuc = long.Parse(MaTam.Substring(2, 6)) + 1;
                MaKhachHang = NumberKhuVuc.ToString();
                for (int i = NumberKhuVuc.ToString().Length; i < 6; i++)
                {
                    MaKhachHang = "0" + MaKhachHang;
                    //MessageBox.Show(MaKhuVuc);
                }
                MaKhachHang = "NG" + MaKhachHang;
            }
            else
            {
                MaKhachHang = "NG000001";
            }
            return(MaKhachHang);
        }