Пример #1
0
 /// <summary>
 /// Bind Output CheckList grid
 /// </summary>
 private void BindGrid()
 {
     objAddressTypeLookup = new AddressTypeLookupDal();
     DataSet dsOutputCheckList = objAddressTypeLookup.GetOutputCheckList("");
     radgrdOutputCheckList.DataSource = dsOutputCheckList;
     radgrdOutputCheckList.DataBind();
     ViewState[vsOutputCheckList] = dsOutputCheckList;
 }
Пример #2
0
 private void Save()
 {
     try
     {
         int result = 0;
         objAddressTypeLookup = new AddressTypeLookupDal();
         objLookupBDto = new LookupBDto();
         objLookupBDto.LookupName = txtOutputCheckListName.Text;
         objLookupBDto.UserProfile = objAuthorizationBDto.UserProfile;
         result = objAddressTypeLookup.InsertOutputCheckList(objLookupBDto);
         if (result >= 1)
         {
             Master.DisplayMessage(ConfigurationSettings.AppSettings[SuccessMessage.Save].ToString());
             Master.MessageCssClass = "successMessage";
         }
         else
         {
             Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Save].ToString());
             Master.MessageCssClass = "errorMessage";
         }
         BindGrid();
         Reset();
     }
     catch (Exception ex)
     {
         bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
         if (rethrow)
         { throw ex; }
     }
 }
Пример #3
0
 protected void acbOutputCheckList_SearchClick(object sender, EventArgs e)
 {
     try
     {
         objAddressTypeLookup = new AddressTypeLookupDal();
         DataSet dsOutputCheckList = objAddressTypeLookup.GetOutputCheckList(acbOutputCheckList.SearchTextBox.Text);
         radgrdOutputCheckList.DataSource = dsOutputCheckList;
         radgrdOutputCheckList.DataBind();
         ViewState[vsOutputCheckList] = dsOutputCheckList;
     }
     catch (Exception ex)
     {
         bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
         if (rethrow)
         { throw ex; }
     }
 }
Пример #4
0
        protected void acbOutputCheckList_DeleteClick(object sender, EventArgs e)
        {
            try
            {
                StringBuilder OutputCheckListId = new StringBuilder();
                int result = 0;
                if (ViewState[PageConstants.vsItemIndexes] != null)
                    htItemIndex = (Hashtable)ViewState[PageConstants.vsItemIndexes];

                if (htItemIndex != null)
                {
                    foreach (int i in htItemIndex.Values)
                    {

                        Label lblOutputCheckListId = (Label)radgrdOutputCheckList.Items[i].FindControl("lblgrdOutputCheckListItem");
                        if (lblOutputCheckListId != null)
                        {
                            OutputCheckListId.Append(lblOutputCheckListId.Text + ",");
                        }
                    }
                }

                objAddressTypeLookup = new AddressTypeLookupDal();
                String AddId = OutputCheckListId.ToString().TrimEnd(',');
                result = objAddressTypeLookup.DeleteOutputCheckList(AddId);

                if (result == 1)
                {
                    Master.DisplayMessage(ConfigurationSettings.AppSettings[SuccessMessage.Delete].ToString());
                    Master.MessageCssClass = "successMessage";
                    ViewState[PageConstants.vsItemIndexes] = null;
                    BindGrid();
                }
                else if (result == 547)
                {
                    Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Delete].ToString());
                    Master.MessageCssClass = "errorMessage";
                }
            }

            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
                if (rethrow)
                { throw ex; }
            }
        }
Пример #5
0
        protected void acbOutputCheckList_SaveClick(object sender, EventArgs e)
        {

            try
            {
                int result = 0;
                objAddressTypeLookup = new AddressTypeLookupDal();
                switch (acbOutputCheckList.SaveButton.CommandName)
                {
                    case "Save":
                        Save();
                        pnlAddNewMode.Visible = false;
                        acbOutputCheckList.EditableMode = false;

                        break;

                    case "Update":
                        try
                        {
                            objAddressTypeLookup = new AddressTypeLookupDal();
                            objLookupBDto = new LookupBDto();
                            if (ViewState[PageConstants.vsItemIndexes] != null)
                            {
                                htItemIndex = (Hashtable)(ViewState[PageConstants.vsItemIndexes]);
                            }
                            int OutputCheckListId = 0;
                            for (int i = 0; i < htItemIndex.Count; i++)
                            {
                                objAuthorizationBDto = new AuthorizationBDto();
                                objLookupBDto = new LookupBDto();

                                Label lblgrdOutputCheckList = (Label)radgrdOutputCheckList.Items[Convert.ToInt32(htItemIndex[i])].FindControl("lblgrdOutputCheckListEdit");
                                TextBox txtgrdOutputCheckList = (TextBox)radgrdOutputCheckList.Items[Convert.ToInt32(htItemIndex[i])].FindControl("txtgrdOutputCheckList");
                                OutputCheckListId = int.Parse(lblgrdOutputCheckList.Text);
                                objAddressTypeLookup = new AddressTypeLookupDal();
                                objLookupBDto = new LookupBDto();
                                objLookupBDto.LookupName = txtgrdOutputCheckList.Text;
                                objLookupBDto.UserProfile = objAuthorizationBDto.UserProfile;
                                objLookupBDto.LookupId = OutputCheckListId;
                                result = objAddressTypeLookup.UpdateOutputCheckList(objLookupBDto);
                            }
                            if (result >= 1)
                            {
                                Master.DisplayMessage(ConfigurationSettings.AppSettings[SuccessMessage.Save].ToString());
                                Master.MessageCssClass = "successMessage";
                            }
                            else
                            {
                                Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Save].ToString());
                                Master.MessageCssClass = "errorMessage";
                            }
                            BindGrid();
                            Reset();
                        }
                        catch (Exception ex) { }

                        result = objAddressTypeLookup.UpdateOutputCheckList(objLookupBDto);
                        if (result == 1)
                        {
                            acbOutputCheckList.DefaultMode = true;
                            Master.DisplayMessage(ConfigurationSettings.AppSettings["UpdateRecord"].ToString());
                            Master.MessageCssClass = "successMessage";

                            if (ViewState[PageConstants.vsItemIndexes] != null)
                                htItemIndex = (Hashtable)ViewState[PageConstants.vsItemIndexes];
                            for (int i = 0; i < htItemIndex.Count; i++)
                                radgrdOutputCheckList.Items[Convert.ToInt32(htItemIndex[i])].Edit = false;
                            bisEdit = false;
                            ViewState[PageConstants.vsItemIndexes] = null;
                            BindGrid();
                        }
                        else
                        {
                            Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Update].ToString());
                            Master.MessageCssClass = "errorMessage";
                        }
                        break;
                }
                objAddressTypeLookup = new AddressTypeLookupDal();
            }

            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
                if (rethrow)
                { throw ex; }
            }
        }
        /// <summary>
        /// Bind Address grid
        /// </summary>

        private void BindGrid()
        {
            objAddressTypeLookup = new AddressTypeLookupDal();
            DataSet dsAddress = objAddressTypeLookup.GetAddressType("");
            radgrdAddress.DataSource = dsAddress;
            radgrdAddress.DataBind();
            ViewState[vsAddress] = dsAddress;

        }
        protected void acbAddress_SaveClick(object sender, EventArgs e)
        {

            try
            {
                int result = 0;
                objAddressTypeLookup = new AddressTypeLookupDal();
                switch (acbAddress.SaveButton.CommandName)
                {
                    case "Save":
                        Save();
                        pnlAddNewMode.Visible = false;
                        acbAddress.EditableMode = false;

                        break;

                    case "Update":
                        String xmlData = GenerateXmlString(radgrdAddress);
                        result = objAddressTypeLookup.UpdateAddress(xmlData);
                        if (result == 1)
                        {
                            acbAddress.DefaultMode = true;
                            Master.DisplayMessage(ConfigurationSettings.AppSettings["UpdateRecord"].ToString());
                            Master.MessageCssClass = "successMessage";

                            if (ViewState[PageConstants.vsItemIndexes] != null)
                                htItemIndex = (Hashtable)ViewState[PageConstants.vsItemIndexes];
                            for (int i = 0; i < htItemIndex.Count; i++)
                                radgrdAddress.Items[Convert.ToInt32(htItemIndex[i])].Edit = false;
                            bisEdit = false;
                            ViewState[PageConstants.vsItemIndexes] = null;
                            BindGrid();
                        }
                        else
                        {
                            Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Update].ToString());
                            Master.MessageCssClass = "errorMessage";
                        }
                        break;
                }
                objAddressTypeLookup = new AddressTypeLookupDal();

            }


            catch (Exception ex)
            {
                bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
                if (rethrow)
                { throw ex; }
            }
        }