Beispiel #1
0
 public CreateDoiTac(InitPage parent, int IDBaiQC)
 {
     InitializeComponent();
     this.OpenMode = MODE_ADD;
     this.parent   = parent;
     this.IDBaiQC  = IDBaiQC;
 }
 /// <summary>
 /// Default constructor
 /// </summary>
 public SanPhamDetail(InitPage parent)
 {
     this.InitializeComponent();
     this.txtID.Enabled = false;
     this.OpenMode      = MODE_ADD;
     this.parent        = parent;
 }
 public InfoParter(InitPage parent)
 {
     this.InitializeComponent();
     this.txtID.Enabled = false;
     this.OpenMode      = MODE_ADD;
     this.parent        = parent;
 }
 public CreateSanPhamImportOrder(InitPage parent, int mode, Models.ItemOrder order, int itemOrder)
 {
     this.InitializeComponent();
     this.parent        = parent;
     this.selectedIndex = itemOrder;
     this.mode          = mode;
     this.InitFormSetting();
     this.LoadOrderData(order);
 }
 public AddQcmoble(InitPage parent)
 {
     this.InitializeComponent();
     this.parent = parent;
     dsDaQC      = parent.quanLyQuangCaoDomain.listQCSDT;
     dsChuaQC    = parent.quanLyKhachHangDomain.listKhachHang;
     dsSP        = parent.quanLySanPhamDomain.listSanPham;
     this.InitSetting();
     this.LoadData();
 }
 /// <summary>
 /// Constructor with fill data to fields
 /// </summary>
 /// <param name="parent"></param>
 public CreateSanPhamImportOrder(InitPage parent, int mode, int itemOrder)
 {
     this.InitializeComponent();
     this.parent        = parent;
     this.selectedIndex = itemOrder;
     this.mode          = mode;
     this.data          = parent.quanLySanPhamDomain.GetLowAmountItem(parent.repository);
     this.InitFormSetting();
     this.LoadData();
 }
Beispiel #7
0
 public CreateDoiTac(int index, DoiTacDTO item, InitPage parent)
 {
     InitializeComponent();
     this.OpenMode            = MODE_EDIT;
     this.itemIndex           = index;
     this.parent              = parent;
     this.EditDoiTac          = item;
     this.TenDoiTac.Text      = item.Ten;
     this.NgayKyHD.Value      = item.NgayKyHD;
     this.NgayKetThucHD.Value = item.NgayHetHanHD;
     this.ViTriDang.Text      = item.ViTriDang;
 }
        public InfoParter(int index, Models.Partner Partner, InitPage parent)
        {
            this.parent    = parent;
            this.itemIndex = index;
            this.OpenMode  = MODE_EDIT;

            this.InitializeComponent();
            this.txtID.Text     = Partner.ID.ToString();
            this.txtName.Text   = Partner.partner_name;
            this.txtInfo.Text   = Partner.infopost;
            this.beginDate.Text = Partner.begindate.ToString();
            this.deadline.Text  = Partner.deadline.ToString();
        }
Beispiel #9
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="index">index of comment</param>
        /// <param name="comment">comment</param>
        /// <param name="currentUser">current user</param>
        /// <param name="customer">person comment</param>
        /// <param name="item">product comment</param>
        /// <param name="parent">parent layout</param>
        public CommentDetail(int index, CommentDTO comment, UserDTO currentUser, InitPage parent, Connection conn)
        {
            ItemDTO item = new QuanLySanPhamBUS().GetItemByID(conn, comment.productID);

            this.comment = comment;
            CustomerDTO customer = new QuanLyKhachHangBUS().loadKhachHangByID(conn, comment.customerID);

            this.parent    = parent;
            this.itemIndex = index;
            this.InitializeComponent();
            this.txtID.Text           = comment.ID.ToString();
            this.txtSPName.Text       = item.name;
            this.txtCustomerName.Text = customer.name;
            this.textBoxEmail.Text    = customer.email;
            this.textBoxAddress.Text  = customer.address;
            this.cbStatus.Text        = DTO.Helper.EnumHelper.StringValueOf((DTO.Helper.MyEnum.TypeComment)comment.status);
            this.txtComment.Text      = comment.detail;
            statusBefore    = comment.status;
            currentCustomer = customer;
            verifyButton();
        }
Beispiel #10
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="index">index of comment</param>
        /// <param name="comment">comment</param>
        /// <param name="currentUser">current user</param>
        /// <param name="customer">person comment</param>
        /// <param name="item">product comment</param>
        /// <param name="parent">parent layout</param>
        public CommentDetail(int index, Models.Comment comment, Models.User currentUser, InitPage parent, Repository.Repository repository)
        {
            Models.Item     item     = new QuanLySanPhamDomain().GetItemByID(repository, comment.productID);
            Models.Customer customer = new QuanLyKhachHangDomain().GetCustomerByID(repository, comment.customerID);
            this.parent    = parent;
            this.itemIndex = index;
            this.InitializeComponent();
            this.txtID.Text           = comment.ID.ToString();
            this.txtSPName.Text       = item.name;
            this.txtCustomerName.Text = customer.name;
            this.textBoxEmail.Text    = customer.email;
            this.textBoxAddress.Text  = customer.address;
            this.cbStatus.Text        = MyEnum.EnumHelper.StringValueOf((MyEnum.MyEnum.TypeComment)comment.status);
            this.txtComment.Text      = comment.detail;
            statusBefore    = comment.status;
            currentCustomer = customer;

            if (currentUser.role == Constants.USERTYPE_MANAGER)
            {
                this.btnScore.Visible  = true;
                this.btnDelete.Visible = true;
                if (comment.handle_type != 0)
                {
                    this.btnScore.Enabled  = false;
                    this.btnDelete.Enabled = false;
                }
            }
            else
            {
                this.btnScore.Visible  = false;
                this.btnDelete.Visible = false;
            }

            if (comment.status > 0)
            {
                this.cbStatus.Enabled = false;
            }
            this.buttonConfirm.Enabled = false;
        }
        /// <summary>
        /// Monitor SanPham information to fields and show UI as privilege
        /// </summary>
        /// <param name="item"></param>
        public SanPhamDetail(int index, Models.Item item, Models.User user, InitPage parent)
        {
            this.parent    = parent;
            this.itemIndex = index;
            this.OpenMode  = MODE_EDIT;

            this.InitializeComponent();
            this.lbName.Text      = item.name;
            this.txtID.Text       = item.ID.ToString();
            this.txtName.Text     = item.name;
            this.txtType.Text     = item.type;
            this.txtAmount.Text   = item.amount.ToString();
            this.txtMinimum.Text  = item.minimum.ToString();
            this.txtProvider.Text = item.provider;

            if (user.role == Constants.USERTYPE_MANAGER)
            {
                this.btnConfirm.Visible  = true;
                this.txtAmount.Enabled   = true;
                this.txtID.Enabled       = false;
                this.txtMinimum.Enabled  = true;
                this.txtName.Enabled     = true;
                this.txtType.Enabled     = true;
                this.txtProvider.Enabled = true;
            }
            else
            {
                this.btnConfirm.Visible  = false;
                this.txtAmount.Enabled   = false;
                this.txtID.Enabled       = false;
                this.txtMinimum.Enabled  = false;
                this.txtName.Enabled     = false;
                this.txtType.Enabled     = false;
                this.txtProvider.Enabled = false;
            }
        }
 public QuangCaoSDT(InitPage parent)
 {
     InitializeComponent();
     this.parent      = parent;
     this.selectQCsdt = this.parent.selectQCsdt;
 }
 public LichSuQC(InitPage parent)
 {
     InitializeComponent();
     this.parent = parent;
 }
Beispiel #14
0
 public SanPhamImport(InitPage parent)
 {
     this.InitializeComponent();
     this.parent = parent;
     this.InitSetting();
 }
 /// <summary>
 /// Constructor of Login Form
 /// </summary>
 public LoginForm(InitPage parent)
 {
     this.InitializeComponent();
     this.InitSetting();
     this.parent = parent;
 }
        /// <summary>
        /// Add SanPham's Import Order to DB
        /// </summary>
        /// <param name="repository"></param>
        public void AddSanPhamImportOrder(Repository.Repository repository, Models.ItemOrder data, InitPage parent)
        {
            string queryString = "";

            for (int i = 0; i < data.listSP.Count; i++)
            {
                data.listSP[i].isImportOrder = true;
                this.UpdateSanPham(repository, data.listSP[i]);
            }
            queryString = "insert into ItemOrder(createddate, owner, type, listItem, isApproved) " +
                          "values('" + String.Format("{0:yyyy/MM/dd}", DateTime.Now) + "'," +
                          "'" + data.owner + "'," +
                          data.type + "," +
                          "'" + this.BuildListIDString(data.listSP) + "'" +
                          ", false)";
            Console.WriteLine(queryString);
            repository.cmd.CommandText = queryString;
            try
            {
                repository.cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    "Có lỗi xảy ra trong quá trình thêm dữ liệu, vui lòng thử lại!\nChi tiết: " + ex.StackTrace,
                    "Lỗi",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }

            this.LoadSanPhamOrder(repository);
            parent.LoadSPOrderCallback();

            this.LoadSanPham(repository);
            parent.dataSanPham = this.listSanPham;
            parent.LoadSanPhamCallback();
        }
        /// <summary>
        /// Delete the order
        /// </summary>
        /// <param name="repository"></param>
        /// <param name="data"></param>
        public void DeleteItemOrder(Repository.Repository repository, Models.ItemOrder data, InitPage parent)
        {
            string queryString = "update ItemOrder set isDeleted=true where id=" + data.ID;

            Console.WriteLine(queryString);
            repository.cmd.CommandText = queryString;
            try
            {
                repository.cmd.ExecuteNonQuery();
                for (int i = 0; i < data.listSP.Count; i++)
                {
                    data.listSP[i].isImportOrder = false;
                    this.UpdateSanPham(repository, data.listSP[i]);
                }
                this.LoadSanPhamOrder(repository);
                parent.LoadSPOrderCallback();

                this.LoadSanPham(repository);
                parent.dataSanPham = this.listSanPham;
                parent.LoadSanPhamCallback();
                parent.selectedBillIndex = -1;
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    "Có lỗi xảy ra trong quá trình cập nhật dữ liệu, vui lòng thử lại!\nChi tiết: " + ex.StackTrace,
                    "Lỗi",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }
Beispiel #18
0
 public TaoQuangCao(InitPage parent)
 {
     InitializeComponent();
     this.parent = parent;
 }
 public GuaranteeOrder(InitPage parent)
 {
     InitializeComponent();
     this.parent = parent;
     this.InitSetting();
 }