Пример #1
0
 public DefaultMaster()
 {
     this._categoryRT        = new CategoryRT();
     this._userInformationRT = new UserInformationRT();
     this._visitorCounterRT  = new VisitorCounterRT();
     this._visitorCounter    = new VisitorCounter();
 }
 public ControlAdminMaster()
 {
     this._categoryRT        = new CategoryRT();
     this._userInformationRT = new UserInformationRT();
     this._userWFPermission  = new UserPermissionRT();
     this._urlWFListRT       = new UrlWFListRT();
 }
Пример #3
0
 protected void lvCategory_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     if (e.CommandName == "EditCategory")
     {
         try
         {
             btnSave.Visible   = false;
             btnUpdate.Visible = true;
             btnDelete.Visible = true;
             btnCancel.Visible = true;
             Int64 categoryID = Convert.ToInt64(e.CommandArgument);
             hdCategoryID.Value = categoryID.ToString();
             using (CategoryRT receiverTransfer = new CategoryRT())
             {
                 Category category = receiverTransfer.GetCategoryByID(categoryID);
                 FillCategoryForEdit(category);
             }
             labelMessage.Text = string.Empty;
         }
         catch (Exception ex)
         {
             labelMessage.Text      = "Error : " + ex.Message;
             labelMessage.ForeColor = System.Drawing.Color.Red;
         }
     }
 }
Пример #4
0
        private void FillCategoryForEdit(Category category)
        {
            try
            {
                if (category != null)
                {
                    txtName.Text     = category.Name;
                    txtSerialNo.Text = category.SerialNo.ToString();
                    using (CategoryRT receiverTransfer = new CategoryRT())
                    {
                        if (category.ParentID != null)
                        {
                            var cat =
                                receiverTransfer.GetCategoryByID(category.ParentID != null
                                    ? Convert.ToInt64(category.ParentID)
                                    : 0);
                            txtParentCategoryID.Text = cat.Name;
                            txtParentID.Text         = category.ParentID != null?Convert.ToString(category.ParentID) : string.Empty;
                        }
                        else
                        {
                            txtParentCategoryID.Text = string.Empty;
                            txtParentID.Text         = string.Empty;
                        }
                    }

                    Session[sessCategory] = category;
                }
            }
            catch (Exception ex)
            {
                labelMessage.Text      = "Error : " + ex.Message;
                labelMessage.ForeColor = System.Drawing.Color.Red;
            }
        }
        public object GetAllCategoryForSearch(string catName)
        {
            List <SP_CategoryTree_GetSearchedCategoryOrAllResult> list = null;

            try
            {
                list = new CategoryRT().GetAllSearchedCategory(catName);

                //var catList = from category in list
                //                select new {category.IID,category.Description,category.Name,category.ParentID};
                //catList = catList.ToList();
                return(list);
            }
            catch (Exception ex)
            {
            }
            //finally
            //{
            //    if (list != null && list.Count > 0)
            //    {
            //        list = list.Take(25).ToList();
            //    }
            //}
            //return null;
            return(list);
        }
Пример #6
0
 public Default()
 {
     this._customClientRT      = new CustomClientRT();
     this._categoryRT          = new CategoryRT();
     this._constantCollection  = new ConstantCollection();
     this._visitorIPMACAddress = new VisitorIPMACAddress();
 }
Пример #7
0
 public DefaultInner()
 {
     this._materialRT          = new MaterialRT();
     this._categoryRT          = new CategoryRT();
     this._visitorIPMACAddress = new VisitorIPMACAddress();
     this._countryRT           = new CountryRT();
     this._divisionOrStateRT   = new DivisionOrStateRT();
 }
Пример #8
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                // labelMessage.Text = string.Empty;
                using (CategoryRT receiverTransfer = new CategoryRT())
                {
                    List <Category> categorieList = new List <Category>();
                    categorieList = receiverTransfer.GetCategoryByName(txtName.Text);
                    bool IsParentIdSame = false;
                    foreach (var cat in categorieList)
                    {
                        if (cat.ParentID == Convert.ToInt32(txtParentID.Text))
                        {
                            IsParentIdSame = true;
                        }
                    }

                    if (IsParentIdSame)
                    {
                        string msg = "Category Name  " + txtName.Text + " Already Exists in this parent category!";
                        //string alertScript =
                        //String.Format("alert('{0}');", msg);
                        //Page.ClientScript.RegisterStartupScript(this.GetType(), "Key", alertScript, true);

                        labelMessage.Text = msg;
                        return;
                    }

                    hdIsEdit.Value = "true";
                    Category category = CreateCategory();


                    if (category != null)
                    {
                        receiverTransfer.UpdateCategory(category);
                        labelMessage.Text      = "Data successfully updated...";
                        labelMessage.ForeColor = System.Drawing.Color.Green;
                    }
                    else
                    {
                        labelMessage.Text      = "Data not updated...";
                        labelMessage.ForeColor = System.Drawing.Color.Red;
                    }
                }
                ClearField();
                LoadCategory();
            }
            catch (Exception ex)
            {
                labelMessage.Text      = "Error : " + ex.Message;
                labelMessage.ForeColor = System.Drawing.Color.Red;
            }
        }
Пример #9
0
 private void LoadDropDownForCategory()
 {
     try
     {
         using (CategoryRT aCategoryRt = new CategoryRT())
         {
             var categoryList = aCategoryRt.GetAllSearchedCategory(" ");
             DropDownListHelper.Bind(dropDownCategory, categoryList, "Description", "IID");
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message, ex);
     }
 }
Пример #10
0
 private void LoadCategory()
 {
     try
     {
         using (CategoryRT receiverTransfer = new CategoryRT())
         {
             lvCategory.DataSource = receiverTransfer.GetAllCategoryForListView();;
             lvCategory.DataBind();
         }
     }
     catch (Exception ex)
     {
         labelMessage.Text      = "Error : " + ex.Message;
         labelMessage.ForeColor = System.Drawing.Color.Red;
     }
 }
Пример #11
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                // labelMessage.Text = string.Empty;
                using (CategoryRT receiverTransfer = new CategoryRT())
                {
                    List <Category> catagory = new List <Category>();

                    catagory = receiverTransfer.GetAllCategoryByParentID(Convert.ToInt32(hdCategoryID.Value.ToString()));
                    if (catagory.Count == 0)
                    {
                        hdIsDelete.Value = "true";
                        hdIsEdit.Value   = "true";
                        Category category = CreateCategory();

                        if (category != null)
                        {
                            receiverTransfer.UpdateCategory(category);
                            labelMessage.Text      = "Data successfully deleted...";
                            labelMessage.ForeColor = System.Drawing.Color.Green;
                        }
                        else
                        {
                            labelMessage.Text      = "Data not deleted...";
                            labelMessage.ForeColor = System.Drawing.Color.Red;
                        }
                    }
                    else
                    {
                        labelMessage.Text      = "Data not deleted. Please Delete the sub category frist.....";
                        labelMessage.ForeColor = System.Drawing.Color.Red;
                    }
                }
                LoadCategory();
                ClearField();
            }
            catch (Exception ex)
            {
                labelMessage.Text      = "Error : " + ex.Message;
                labelMessage.ForeColor = System.Drawing.Color.Red;
            }
        }
 public LoginMaster()
 {
     this._categoryRT        = new CategoryRT();
     this._userInformationRT = new UserInformationRT();
 }
 public InnerMasterPage()
 {
     this._categoryRT        = new CategoryRT();
     this._userInformationRT = new UserInformationRT();
 }