Beispiel #1
0
        private void BindParamsDropDown()
        {
            //TODO : This method will be called on Page Load
            ChannelManegmentDAO _ObjCMDAO = new ChannelManegmentDAO();
            DropDownChannelParams ObjDropDown = _ObjCMDAO.GetChannelParams();
            drpParams.ClearSelection();
            drpParams.Items.Clear();
            drpParams.Attributes.Clear();
            foreach (var item in ObjDropDown.lstChannelParams)
            {
                ListItem _objItem = new ListItem();
                _objItem.Attributes.Add("Description", item.Description);
                _objItem.Attributes.Add("IsRequired", item.IsRequired.ToString());
                _objItem.Text = item.Text;
                _objItem.Value = item.Value.ToString();
                drpParams.Items.Add(_objItem);
            }

            drpParams.DataBind();
        }
Beispiel #2
0
        protected void gdvParameter_RowEditing(object sender, GridViewEditEventArgs e)
        {
            try
            {
                GridView gdv = (GridView)sender;
                int iRow = e.NewEditIndex;
                string strChannelType = gdv.DataKeys[iRow].Values["ChannelType"].ToString();
                string strChannelID = gdv.DataKeys[iRow].Values["ChannelID"].ToString();
                int intChannelCode = gdv.DataKeys[iRow].Values["ChannelCode"] == null ? 0 : Convert.ToInt32(gdv.DataKeys[iRow].Values["ChannelCode"]);
                string strChannelDescription = gdv.DataKeys[iRow].Values["ChannelDescription"].ToString();

                drpChannelType.SelectedValue = strChannelType;
                txtChannelID.Text = strChannelID;
                hdnChannelCode.Value = intChannelCode.ToString();
                txtChannelDesc.Text = strChannelDescription;

                ChannelManegmentDAO _ObjDAO = new ChannelManegmentDAO();
                lstChannelParamsDetails = _ObjDAO.GetParamDetails(intChannelCode, strChannelID);
                BindParamToChannel();

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
Beispiel #3
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string message = string.Empty;
            string type = string.Empty;
            Type cstype = this.GetType();

            try
            {
                //string strKey = "popup";
                //string strScript = "RaisePopUp();";
                //ScriptManager.RegisterStartupScript(this, this.GetType(), strKey, strScript, true);

                List<ChannelParamsDetails> LstParams = lstChannelParamsDetails;
                List<ChannelManagementModel> LstHdrModel = new List<ChannelManagementModel>();

                if (LstParams == null || LstParams.Count <= 0)
                {
                    BindParamToChannel();
                    message = "No channel information provided for saving.";
                    type = "error";
                   //////////// AppMessage.Notify(this, cstype, "NullParamDef", message, "", type, "", 0, false);
                    return;
                }

                ChannelManagementModel obj = new ChannelManagementModel();
                obj.ChannelCode = Convert.ToInt32(string.IsNullOrEmpty(hdnChannelCode.Value) ? "0" : hdnChannelCode.Value);
                obj.ChannelType = Convert.ToInt32(drpChannelType.SelectedValue);
                obj.ChannelTypeName = drpChannelType.SelectedItem.Text.Trim();
                obj.ChannelID = txtChannelID.Text.Trim();
                obj.ChannelDescription = txtChannelDesc.Text.Trim();
                obj.lstParamsDetails = LstParams;
                LstHdrModel.Add(obj);

                ChannelManegmentDAO _ObjCMDAO = new ChannelManegmentDAO();
                if (_ObjCMDAO.Save(LstHdrModel))
                {
                    Reset();
                    BindGrid();
                    message = "Data Saved Successfully.";
                    type = "success";
                   ///////// AppMessage.Notify(this, cstype, "ParamSaveSuccess", message, "", type, "", 0, false);
                }
                else
                {
                    message = "Error while saving data.";
                    type = "error";
                   //////// AppMessage.Notify(this, cstype, "ParamSaveError", message, "", type, "", 0, false);
                }

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
Beispiel #4
0
        protected void gdvParameter_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                GridView gdv = (GridView)sender;
                int iRow = e.RowIndex;
                int intChannelCode = gdv.DataKeys[iRow].Values["ChannelCode"] == null ? 0 : Convert.ToInt32(gdv.DataKeys[iRow].Values["ChannelCode"]);
                string strChannelID = gdv.DataKeys[iRow].Values["ChannelID"] == null ? "" : gdv.DataKeys[iRow].Values["ChannelID"].ToString();

                ChannelManegmentDAO _ObjDAO = new ChannelManegmentDAO();
                _ObjDAO.DeleteChannel(intChannelCode, strChannelID);
                BindGrid();
                lstChannelParamsDetails = null;
                BindParamToChannel();
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
Beispiel #5
0
 public void BindGrid()
 {
     ChannelManegmentDAO _ObjCMDAO = new ChannelManegmentDAO();
     gdvParameter.DataSource = _ObjCMDAO.GetChannelData();
     gdvParameter.DataBind();
 }