public virtual CloudAccountDA.ClientMasterDataTable GetData()
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     CloudAccountDA.ClientMasterDataTable dataTable = new CloudAccountDA.ClientMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
 public virtual int Fill(CloudAccountDA.ClientMasterDataTable dataTable)
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if (this.ClearBeforeFill)
     {
         dataTable.Clear();
     }
     return(this.Adapter.Fill(dataTable));
 }
 private void SetRecord(string iD)
 {
     this.objClientMasterDT = this.objClientMasterBll.GetDataByClientID(int.Parse(iD));
     if (this.objClientMasterDT.Rows.Count <= 0)
     {
         return;
     }
     this.hfClient.Value    = this.objClientMasterDT.Rows[0]["ClientID"].ToString();
     this.txtURL.Text       = this.objClientMasterDT.Rows[0]["ClientURL"].ToString();
     this.txtName.Text      = this.objClientMasterDT.Rows[0]["ClientName"].ToString();
     this.chkStatus.Checked = this.objClientMasterDT.Rows[0]["ClientStatus"].ToString() == "True";
 }
 public Stream ShowProfileImage(int conId)
 {
     this._objClientMasterDt = this._objClientMasterBll.GetDataByClientID(conId);
     try
     {
         return((Stream) new MemoryStream((byte[])this._objClientMasterDt.Rows[0]["ClientLogo"]));
     }
     catch
     {
         return((Stream)null);
     }
 }
 private void ViewRecord(string i)
 {
     this.objClientMasterDT = this.objClientMasterBll.GetDataByClientID(int.Parse(i));
     if (this.objClientMasterDT.Rows.Count <= 0)
     {
         return;
     }
     this.hfClient.Value   = this.objClientMasterDT.Rows[0]["ClientID"].ToString();
     this.lblURL.Text      = this.objClientMasterDT.Rows[0]["ClientURL"].ToString();
     this.lblName.Text     = this.objClientMasterDT.Rows[0]["ClientName"].ToString();
     this.lblStatus.Text   = this.objClientMasterDT.Rows[0]["ClientStatus"].ToString() == "True" ? "True" : "False";
     this.imgLogo.ImageUrl = "~/Handler/ClientHandler.ashx?id=" + this.hfClient.Value;
 }
 public virtual CloudAccountDA.ClientMasterDataTable GetDataByClientID(int?ClientID)
 {
     this.Adapter.SelectCommand = this.CommandCollection[1];
     if (ClientID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = ClientID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     CloudAccountDA.ClientMasterDataTable dataTable = new CloudAccountDA.ClientMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
 public virtual CloudAccountDA.ClientMasterDataTable GetDataByClientName(string ClientName)
 {
     this.Adapter.SelectCommand = this.CommandCollection[2];
     if (ClientName == null)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = ClientName;
     }
     CloudAccountDA.ClientMasterDataTable dataTable = new CloudAccountDA.ClientMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.Page.IsValid)
         {
             if (this.txtURL.Text.Trim().Length > 0 && this.txtName.Text.Trim().Length > 0)
             {
                 bool flag;
                 if (this.fuLogo.HasFile)
                 {
                     int    contentLength = this.fuLogo.PostedFile.ContentLength;
                     byte[] numArray      = new byte[contentLength];
                     this.fuLogo.PostedFile.InputStream.Read(numArray, 0, contentLength);
                     flag = this.objClientMasterBll.UpdateClient(int.Parse(this.hfClient.Value.Trim()), this.txtName.Text.Trim(), this.txtURL.Text.Trim(), this.chkStatus.Checked, numArray);
                 }
                 else
                 {
                     this.objClientMasterDT = this.objClientMasterBll.GetDataByClientID(int.Parse(this.hfClient.Value.Trim()));
                     flag = this.objClientMasterBll.UpdateClient(int.Parse(this.hfClient.Value.Trim()), this.txtName.Text.Trim(), this.txtURL.Text.Trim(), this.chkStatus.Checked, (byte[])this.objClientMasterDT.Rows[0]["ClientLogo"]);
                 }
                 if (flag)
                 {
                     this.DisplayAlert("Update Successfully..");
                     this.Response.Redirect("~/BillTransact/ClientMaster.aspx?cmd=view&ID=" + this.Request.QueryString["ID"]);
                 }
                 else
                 {
                     this.DisplayAlert("Fail to Update Details.");
                 }
             }
             else
             {
                 this.DisplayAlert("Please Fill All Details...!");
             }
         }
         else
         {
             this.DisplayAlert("Fail to Update Details.");
         }
     }
     catch (Exception ex)
     {
         this.DisplayAlert(ex.Message);
     }
 }
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (!this.Page.IsValid)
     {
         return;
     }
     if (this.txtURL.Text.Trim().Length > 0 && this.txtName.Text.Trim().Length > 0 && this.fuLogo.HasFile)
     {
         this.objClientMasterDT = this.objClientMasterBll.GetDataByClientName(this.txtName.Text);
         if (this.objClientMasterDT.Rows.Count > 0)
         {
             this.DisplayAlert("Client Already Exist..");
             this.checkInDB = true;
         }
         else
         {
             this.checkInDB = false;
         }
         if (!this.checkInDB)
         {
             int    contentLength = this.fuLogo.PostedFile.ContentLength;
             byte[] numArray      = new byte[contentLength];
             this.fuLogo.PostedFile.InputStream.Read(numArray, 0, contentLength);
             int num = this.objClientMasterBll.AddClient(this.txtName.Text.Trim(), this.txtURL.Text.Trim(), this.chkStatus.Checked, numArray);
             if (num != 0)
             {
                 this.DisplayAlert("Details Added Successfully.");
                 this.Response.Redirect("~/BillTransact/ClientMaster.aspx?cmd=view&ID=" + (object)num);
             }
             else
             {
                 this.DisplayAlert("Fail to Add New Details.");
                 this.Clear();
             }
         }
         else
         {
             this.DisplayAlert("Fail to Add New Details.");
             this.Clear();
         }
     }
     else
     {
         this.DisplayAlert("Please Fill All Details...!");
     }
 }
 public virtual int Update(CloudAccountDA.ClientMasterDataTable dataTable)
 {
     return(this.Adapter.Update(dataTable));
 }