protected void btnSaveAdd_Click(object sender, EventArgs e) { if (!this.Page.IsValid || !this.Page.IsValid) { return; } if (this.txtTaskName.Text.Trim().Length > 0) { this.objTaskMasterDT = this.objTaskMasterBll.GetDataByTaskName(int.Parse(this.hfCompanyID.Value), this.txtTaskName.Text.Trim()); if (this.objTaskMasterDT.Rows.Count > 0) { this.checkInDB = true; this.DisplayAlert("Task Already Exists..!"); } if (this.checkInDB) { return; } if (this.objTaskMasterBll.AddTask(int.Parse(this.hfCompanyID.Value), this.txtTaskName.Text.Trim(), this.txtTaskDesc.Text.Trim(), this.chkBill.Checked, new Decimal?(Decimal.Parse(this.txtBillClient.Text.Trim())), true, false, false) != 0) { this.Session["saveTask"] = (object)1; this.DisplayAlert("Details Added Successfully."); this.btnAdd_Click(sender, e); } else { this.DisplayAlert("Fail to Add New Details."); this.Clear(); } } else { this.DisplayAlert("Please Fill All Details...!"); } }
public virtual CloudAccountDA.TaskMasterDataTable UpdateWhenDelete(int?TaskID, bool?Active, bool?Deleted) { this.Adapter.SelectCommand = this.CommandCollection[7]; if (TaskID.HasValue) { this.Adapter.SelectCommand.Parameters[1].Value = TaskID.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } if (Active.HasValue) { this.Adapter.SelectCommand.Parameters[2].Value = Active.Value; } else { this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value; } if (Deleted.HasValue) { this.Adapter.SelectCommand.Parameters[3].Value = Deleted.Value; } else { this.Adapter.SelectCommand.Parameters[3].Value = DBNull.Value; } CloudAccountDA.TaskMasterDataTable dataTable = new CloudAccountDA.TaskMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
public virtual CloudAccountDA.TaskMasterDataTable GetData() { this.Adapter.SelectCommand = this.CommandCollection[0]; CloudAccountDA.TaskMasterDataTable dataTable = new CloudAccountDA.TaskMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
public virtual int Fill(CloudAccountDA.TaskMasterDataTable dataTable) { this.Adapter.SelectCommand = this.CommandCollection[0]; if (this.ClearBeforeFill) { dataTable.Clear(); } return(this.Adapter.Fill(dataTable)); }
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType != DataControlRowType.DataRow) { return; } this.objProjectMasterDT = this.objProjectMasterBll.GetDataByProjectID(int.Parse(e.Row.Cells[0].Text)); e.Row.Cells[0].Text = this.objProjectMasterDT.Rows[0]["ProjectName"].ToString(); this.objTaskMasterDT = this.objTaskMasterBll.GetDataByTaskID(int.Parse(e.Row.Cells[1].Text)); e.Row.Cells[1].Text = this.objTaskMasterDT.Rows[0]["TaskName"].ToString(); }
private void SetRecord(string iD) { this.objTaskMasterDT = this.objTaskMasterBll.GetDataByTaskID(int.Parse(iD)); if (this.objTaskMasterDT.Rows.Count <= 0) { return; } this.hfTaskID.Value = this.objTaskMasterDT.Rows[0]["TaskID"].ToString(); this.hfCompanyID.Value = this.objTaskMasterDT.Rows[0]["CompanyID"].ToString(); this.txtTaskName.Text = this.objTaskMasterDT.Rows[0]["TaskName"].ToString(); this.txtTaskDesc.Text = this.objTaskMasterDT.Rows[0]["TaskDesc"].ToString(); this.txtBillClient.Text = this.objTaskMasterDT.Rows[0]["RatePerHours"].ToString(); this.chkBill.Checked = bool.Parse(this.objTaskMasterDT.Rows[0]["BillToClient"].ToString()); }
public virtual CloudAccountDA.TaskMasterDataTable DeleteByCompanyID(int?CompanyID) { this.Adapter.SelectCommand = this.CommandCollection[1]; if (CompanyID.HasValue) { this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } CloudAccountDA.TaskMasterDataTable dataTable = new CloudAccountDA.TaskMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
protected void gvTaskView_OnRowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType != DataControlRowType.DataRow) { return; } string text1 = e.Row.Cells[0].Text; string text2 = e.Row.Cells[4].Text; string text3 = e.Row.Cells[5].Text; this.objTaskMasterDT = this.objTaskMasterBll.GetDataByTaskID(int.Parse(text1)); if (this.objTaskMasterDT.Rows.Count > 0) { e.Row.Cells[0].Text = this.objTaskMasterDT.Rows[0]["TaskName"].ToString(); } try { if (!string.IsNullOrEmpty(text2) && !text2.Contains("&")) { this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(text2)); if (this.objTaxMasterDT.Rows.Count > 0) { e.Row.Cells[4].Text = this.objTaxMasterDT.Rows[0]["TaxName"].ToString(); } } if (string.IsNullOrEmpty(text3) || text3.Contains("&")) { return; } this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(text3)); if (this.objTaxMasterDT.Rows.Count <= 0) { return; } e.Row.Cells[5].Text = this.objTaxMasterDT.Rows[0]["TaxName"].ToString(); } catch (Exception ex) { e.Row.Cells[4].Text = ""; e.Row.Cells[5].Text = ""; } }
private void ViewRecord(string iD) { this.objContractorMasterDT = this.objContractorMasterBll.GetDataByContractorID(int.Parse(iD)); if (this.objContractorMasterDT.Rows.Count <= 0) { return; } this.hfContractorID.Value = this.objContractorMasterDT.Rows[0]["ContractorID"].ToString(); this.hfCompanyID.Value = this.objContractorMasterDT.Rows[0]["CompanyID"].ToString(); this.lblContractorName1.Text = this.lblContractorName.Text = this.objContractorMasterDT.Rows[0]["ContractorName"].ToString(); this.lblContractorEmail.Text = this.objContractorMasterDT.Rows[0]["ContractorEmail"].ToString(); this.lblRebillRate.Text = this.objContractorMasterDT.Rows[0]["RebillRate"].ToString(); string s = this.objContractorMasterDT.Rows[0]["TaskID"].ToString(); if (string.IsNullOrEmpty(s)) { return; } this.objTaskMasterDT = this.objTaskMasterBll.GetDataByTaskID(int.Parse(s)); this.lblTask.Text = this.objTaskMasterDT.Rows[0]["TaskName"].ToString(); }
public virtual CloudAccountDA.TaskMasterDataTable GetDataByCompanyIDAndStatus(int?CompanyID, bool?Active, bool?Archived, bool?Deleted) { this.Adapter.SelectCommand = this.CommandCollection[3]; if (CompanyID.HasValue) { this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } if (Active.HasValue) { this.Adapter.SelectCommand.Parameters[2].Value = Active.Value; } else { this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value; } if (Archived.HasValue) { this.Adapter.SelectCommand.Parameters[3].Value = Archived.Value; } else { this.Adapter.SelectCommand.Parameters[3].Value = DBNull.Value; } if (Deleted.HasValue) { this.Adapter.SelectCommand.Parameters[4].Value = Deleted.Value; } else { this.Adapter.SelectCommand.Parameters[4].Value = DBNull.Value; } CloudAccountDA.TaskMasterDataTable dataTable = new CloudAccountDA.TaskMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
public virtual CloudAccountDA.TaskMasterDataTable GetDataByTaskName(int?CompanyID, string TaskName) { this.Adapter.SelectCommand = this.CommandCollection[5]; if (CompanyID.HasValue) { this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } if (TaskName == null) { this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value; } else { this.Adapter.SelectCommand.Parameters[2].Value = TaskName; } CloudAccountDA.TaskMasterDataTable dataTable = new CloudAccountDA.TaskMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
protected void lnkTimesheet_OnClick(object sender, EventArgs e) { SqlCommand sqlCommand = new SqlCommand("PR_ExportTimesheetTocsv_SelectAll", new SqlConnection(this.conn)); sqlCommand.CommandType = CommandType.StoredProcedure; SqlCommand selectCommand = sqlCommand; selectCommand.Parameters.Add(new SqlParameter("@CompanyID", (object)this.hfCompanyID.Value)); SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommand); DataSet dataSet = new DataSet(); sqlDataAdapter.Fill(dataSet); DataTable dataTable = dataSet.Tables[0]; if (dataTable.Rows.Count <= 0) { return; } string str1 = string.Empty; foreach (DataColumn dataColumn in (InternalDataCollectionBase)dataTable.Columns) { str1 = str1 + (object)dataColumn.ColumnName + (string)(object)','; } string str2 = str1 + "\r\n"; foreach (DataRow dataRow in (InternalDataCollectionBase)dataTable.Rows) { foreach (DataColumn dataColumn in (InternalDataCollectionBase)dataTable.Columns) { if (dataColumn.ColumnName == "full_name") { bool flag = false; string str3 = dataRow[dataColumn.ColumnName].ToString(); this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyUserName(str3); if (this.objCompanyMasterDT.Rows.Count > 0) { dataRow[dataColumn.ColumnName] = (object)this.objCompanyMasterDT.Rows[0]["CompanyContactPerson"].ToString(); flag = true; } if (!flag) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str3); if (this.objStaffMasterDT.Rows.Count > 0) { dataRow[dataColumn.ColumnName] = (object)((string)this.objStaffMasterDT.Rows[0]["FirstName"] + (object)" " + (string)this.objStaffMasterDT.Rows[0]["LastName"]); } } } if (dataColumn.ColumnName == "project") { string s = dataRow[dataColumn.ColumnName].ToString(); if (!string.IsNullOrEmpty(s)) { this.objProjectMasterDT = this.objProjectMasterBll.GetDataByProjectID(int.Parse(s)); dataRow[dataColumn.ColumnName] = (object)this.objProjectMasterDT.Rows[0]["ProjectName"].ToString(); } else { dataRow[dataColumn.ColumnName] = (object)""; } } if (dataColumn.ColumnName == "task") { string s = dataRow[dataColumn.ColumnName].ToString(); if (!string.IsNullOrEmpty(s)) { this.objTaskMasterDT = this.objTaskMasterBll.GetDataByTaskID(int.Parse(s)); dataRow[dataColumn.ColumnName] = (object)this.objTaskMasterDT.Rows[0]["TaskName"].ToString(); } else { dataRow[dataColumn.ColumnName] = (object)""; } } str2 = str2 + (object)dataRow[dataColumn.ColumnName].ToString().Replace(",", ";") + (string)(object)','; } str2 += "\r\n"; } this.Response.Clear(); this.Response.Buffer = true; this.Response.AddHeader("content-disposition", "attachment;filename=" + this.hfCompanyName.Value + "_Timesheets.csv"); this.Response.Charset = ""; this.Response.ContentType = "application/text"; this.Response.Output.Write(str2); this.Response.Flush(); this.Response.End(); }
public virtual int Update(CloudAccountDA.TaskMasterDataTable dataTable) { return(this.Adapter.Update(dataTable)); }