Example #1
0
 public void Update(SeriesPart entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException("entity");
     }
     base.Edit(entity);
 }
Example #2
0
 public frmEditSeriesPart(SeriesPart serie, int cateId, string parrentNodeName)
 {
     InitializeComponent();
     m_Serie             = serie;
     lblNotify1.Text     = string.Empty;
     m_cateId            = cateId;
     txtParrentName.Text = parrentNodeName;
 }
Example #3
0
        public void Remove(SeriesPart entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            base.Delete(entity);
        }
Example #4
0
        public int AddandGetRequestPaymentId(SeriesPart entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            string insert = string.Format(@"insert into SeriesPart(SeriesPartCode,SeriesPartName,TypePartId,Note,CreateBy,CreateDate,ModifyBy,ModifyDate) output  inserted.SeriesPartId  values (@SeriesPartCode,@SeriesPartName,@TypePartId,@Note,@CreateBy,@CreateDate,@ModifyBy,@ModifyDate)");

            return(Connection.ExecuteScalar <int>(insert, entity, Transaction));
        }
Example #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (m_Sub == null)
            {
                lblNotify1.SetText(UI.hasnoinfomation, ToolBoxCS.LabelNotify.EnumStatus.Failed);
                return;
            }
            SeriesPart serie = new SeriesPart();

            serie.TypePartId     = m_Sub.TypePartID;
            serie.SeriesPartCode = txtCode.Text;
            serie.SeriesPartName = txtName.Text;
            serie.Note           = txtNote.Text;
            try
            {
                int Id = 0;
                using (IUnitOfWork uow = new UnitOfWork())
                {
                    Id = uow.SeriesPartBaseRepository.AddandGetRequestPaymentId(serie);
                    uow.Commit();
                }
                TreeTagPart treeTag = new TreeTagPart();
                treeTag.NodeTye         = TreeTagPart.Types.SeriesPart;
                treeTag.TypePartIDTag   = m_Sub.TypePartID;
                treeTag.GroupPartIDTag  = m_Sub.GroupPartId.Value;
                treeTag.SeriesPartIDTag = Id;
                TreeNode node = new TreeNode(serie.SeriesPartName);
                node.Tag = treeTag;
                if (AddNode != null)
                {
                    AddNode(node);
                }
                lblNotify1.SetText(UI.createsuccess, ToolBoxCS.LabelNotify.EnumStatus.Success);
                Close();
            }
            catch
            {
                lblNotify1.SetText(UI.createfailed, ToolBoxCS.LabelNotify.EnumStatus.Failed);
            }
        }
Example #6
0
        public static void BindSeriesParttWidthALl(MetroSearchComboBox cbb, string typePartID)
        {
            IList <SeriesPart> lstSupplier;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstSupplier = typePartID == "0" ? uow.SeriesPartBaseRepository.All() : uow.SeriesPartBaseRepository.FindByTypeID(int.Parse(typePartID));

                uow.Commit();
            }
            if (lstSupplier == null)
            {
                return;
            }
            cbb.DataSource = null;
            SeriesPart objAll = new SeriesPart {
                SeriesPartName = "Tất cả", SeriesPartId = 0
            };

            lstSupplier.Add(objAll);
            cbb.DataSource    = lstSupplier;
            cbb.DisplayMember = "SeriesPartName";
            cbb.ValueMember   = "SeriesPartId";
        }
Example #7
0
 private void InitializeForm(SeriesPart serie)
 {
     txtName.Text = serie.SeriesPartName;
     txtNote.Text = serie.Note;
     txtCode.Text = serie.SeriesPartCode;
 }
Example #8
0
 public void Add(SeriesPart entry)
 {
     throw new NotImplementedException();
 }