protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e)
        {
            iCompanySetupClient CompanyClient = new iCompanySetupClient();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                mChannel      Channel = new mChannel();
                if (hdnState.Value == "Edit")
                {
                    Channel = CompanyClient.GetChannelByChanID(long.Parse(hdnselectedchanID.Value), profile.DBConnection._constr);
                }
                Channel.ChannelName = txtchannelname.Text;
                Channel.ChannelURL  = txtchanlUrl.Text;
                Channel.UserName    = txtusername.Text;
                Channel.Password    = txtpassword.Text;
                Channel.TypeID      = long.Parse(ddlchantype.SelectedItem.Value);
                if (hdnchannelid.Value != "")
                {
                    Channel.StandardChannelID = long.Parse(hdnchannelid.Value);
                }
                if (hndCompanyid.Value != "")
                {
                    Channel.CompanyID = long.Parse(hndCompanyid.Value);
                }
                Channel.CustomerID = long.Parse(hdncustomerid.Value);
                Channel.Active     = "Yes";
                if (rbtnActiveYes.Checked != true)
                {
                    Channel.Active = "No";
                }

                if (hdnState.Value == "Edit")
                {
                    Channel.ModifiedBy   = profile.Personal.UserID;
                    Channel.ModifiedDate = DateTime.Today;
                    long channelid = CompanyClient.SaveChannelDetail(Channel, profile.DBConnection._constr);
                }
                else
                {
                    Channel.CreatedBy    = profile.Personal.UserID;
                    Channel.CreationDate = DateTime.Now;
                    long channelid = CompanyClient.SaveChannelDetail(Channel, profile.DBConnection._constr);
                }
                WebMsgBox.MsgBox.Show("Record saved successfully");
                WarehouseGridBind();
                clear();
                setActiveTab(0);
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Channel Master", "Save");
            }
            finally
            {
                CompanyClient.Close();
            }
        }
示例#2
0
 /// <summary>
 /// 修改后台频道
 /// </summary>
 /// <param name="Info"></param>
 public int ChannelUpdate(mChannel Info)
 {
     SqlParameter[] par = new SqlParameter[] {
         new SqlParameter("@Id", Info.Id),
         new SqlParameter("@Title", Info.Title),
         new SqlParameter("@Note", Info.Note),
         new SqlParameter("@Target", Info.Target),
         new SqlParameter("@Url", Info.Url),
         new SqlParameter("@ParentId", Info.ParentId),
         new SqlParameter("@Setting", Info.Setting),
         new SqlParameter("@IsLock", Info.IsLock)
     };
     return(StringDeal.ToInt(SQLHelper.ExecuteScalar("ChannelEdit", par)));
 }
示例#3
0
 /// <summary>
 /// 添加后台频道
 /// </summary>
 /// <param name="Info"></param>
 public void ChannelInsert(mChannel Info)
 {
     SqlParameter[] par = new SqlParameter[]
     {
         new SqlParameter("@Title", Info.Title),
         new SqlParameter("@Note", Info.Note),
         new SqlParameter("@Target", Info.Target),
         new SqlParameter("@Url", Info.Url),
         new SqlParameter("@Setting", Info.Setting),
         new SqlParameter("@IsLock", Info.IsLock),
         new SqlParameter("@ParentId", Info.ParentId)
     };
     SQLHelper.ExecuteNonQuery("ChannelInsert", par);
 }
示例#4
0
        /// <summary>
        /// 读取后台频道单条数据
        /// </summary>
        /// <param name="Info"></param>
        /// <returns></returns>
        public IList <mChannel> ChannelRead(mChannel Info)
        {
            IList <mChannel> list = new List <mChannel>();

            using (SqlDataReader dr = SQLHelper.ExecuteReader("ChannelRead", Info.Id))
            {
                if (dr.Read())
                {
                    mChannel mC = new mChannel();
                    mC.Title    = dr[0].ToString();
                    mC.Note     = dr[1].ToString();
                    mC.Target   = dr[2].ToString();
                    mC.Url      = dr[3].ToString();
                    mC.ParentId = StringDeal.ToInt(dr[4]);
                    mC.Setting  = dr[5].ToString();
                    list.Add(mC);
                }
            }
            return(list);
        }
        public void GetChannelForEdit(long channelID)
        {
            iCompanySetupClient CompanyClient = new iCompanySetupClient();
            CustomProfile       profile       = CustomProfile.GetProfile();

            try
            {
                mChannel chan = new mChannel();
                chan = CompanyClient.GetChannelByChanID(channelID, profile.DBConnection._constr);
                if (chan.ChannelName != null)
                {
                    txtchannelname.Text = chan.ChannelName.ToString();
                }
                if (chan.ChannelURL != null)
                {
                    txtchanlUrl.Text = chan.ChannelURL.ToString();
                }
                if (chan.UserName != null)
                {
                    txtusername.Text = chan.UserName.ToString();
                }
                if (chan.Password != null)
                {
                    txtpassword.Text = chan.Password.ToString();
                }
                txtpassword.Attributes["value"] = chan.Password.ToString();
                if (chan.Active == "No")
                {
                    rbtnActiveNo.Checked = true;
                }
                FillCompany();
                if (chan.CompanyID != null)
                {
                    ddlcompany.SelectedIndex = ddlcompany.Items.IndexOf(ddlcompany.Items.FindByValue(chan.CompanyID.ToString()));
                }
                hndCompanyid.Value = chan.CompanyID.ToString();
                getCustomer(long.Parse(chan.CompanyID.ToString()));
                if (chan.CustomerID != null)
                {
                    ddlcutomer.SelectedIndex = ddlcutomer.Items.IndexOf(ddlcutomer.Items.FindByValue(chan.CustomerID.ToString()));
                }
                hdncustomerid.Value = chan.CustomerID.ToString();
                // if (chan.TypeID != null) ddlchantype.SelectedIndex = ddlcutomer.Items.IndexOf(ddlchantype.Items.FindByValue(chan.TypeID.ToString()));
                if (chan.TypeID != null)
                {
                    ddlchantype.SelectedItem.Value = chan.TypeID.ToString();
                }
                ddlchantype.SelectedValue = chan.TypeID.ToString();
                if (chan.TypeID.ToString() == "1")
                {
                    ddlchantype.SelectedIndex = 1;
                }
                else if (chan.TypeID.ToString() == "2")
                {
                    ddlchantype.SelectedIndex = 2;
                }

                if (chan.TypeID.ToString() == "1")
                {
                    GetChannelByType();
                    if (chan.StandardChannelID != null)
                    {
                        ddlchannel.SelectedIndex = ddlchannel.Items.IndexOf(ddlchannel.Items.FindByValue(chan.StandardChannelID.ToString()));
                    }
                }
                else
                {
                    ddlchannel.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Channel Master", "GetChannelForEdit");
            }
            finally
            {
                CompanyClient.Close();
            }
        }
示例#6
0
 public IList <mChannel> ChannelRead(mChannel Info)
 {
     return(dal.ChannelRead(Info));
 }
示例#7
0
 public int ChannelUpdate(mChannel Info)
 {
     return(dal.ChannelUpdate(Info));
 }
示例#8
0
 public void ChannelInsert(mChannel Info)
 {
     dal.ChannelInsert(Info);
 }