public String DeleteBulkNotOffered() { String Status = ""; SqlParameter param = new SqlParameter(); SqlParameter statusParam = new SqlParameter(); SqlParameter identityParam = new SqlParameter(); List <SqlParameter> paramList = new List <SqlParameter>(); param = SQLHelper.CreateParameter("@Division", SqlDbType.VarChar, 50); param.Value = StrDivision; paramList.Add(param); param = SQLHelper.CreateParameter("@dateEntered", SqlDbType.DateTime); param.Value = Convert.ToDateTime(DtDate.ToShortDateString()); paramList.Add(param); param = SQLHelper.CreateParameter("@NOCode", SqlDbType.VarChar, 50); param.Value = StrNOCode; paramList.Add(param); param = SQLHelper.CreateParameter("@userId", SqlDbType.VarChar, 50); param.Value = StrUserId; paramList.Add(param); SqlCommand cmd = new SqlCommand(); cmd = SQLHelper.CreateCommand("spDeleteBulkNotOfferedDivisionWise", CommandType.StoredProcedure, paramList); statusParam = cmd.Parameters.Add("@state", SqlDbType.VarChar, 50); statusParam.Direction = ParameterDirection.Output; SQLHelper.ExecuteNonQuery(cmd); Status = statusParam.Value.ToString(); cmd.Dispose(); return(Status); }
public String DeleteMusterChitEntry() { String Status = ""; SqlParameter param = new SqlParameter(); SqlParameter statusParam = new SqlParameter(); SqlParameter identityParam = new SqlParameter(); List <SqlParameter> paramList = new List <SqlParameter>(); param = SQLHelper.CreateParameter("@dateEntered", SqlDbType.DateTime); param.Value = Convert.ToDateTime(DtDate.ToShortDateString()); paramList.Add(param); param = SQLHelper.CreateParameter("@divisionId", SqlDbType.VarChar, 50); param.Value = StrDivision; paramList.Add(param); param = SQLHelper.CreateParameter("@FieldId", SqlDbType.VarChar, 50); param.Value = StrField; paramList.Add(param); param = SQLHelper.CreateParameter("@MainACCode", SqlDbType.VarChar, 50); param.Value = StrACCode; paramList.Add(param); param = SQLHelper.CreateParameter("@GangNumber", SqlDbType.VarChar, 50); param.Value = StrGangNumber; paramList.Add(param); param = SQLHelper.CreateParameter("@ChitNumber", SqlDbType.VarChar, 50); param.Value = StrChitNo; paramList.Add(param); param = SQLHelper.CreateParameter("@Job", SqlDbType.VarChar, 50); param.Value = StrJobShortName; paramList.Add(param); param = SQLHelper.CreateParameter("@CropType", SqlDbType.Int); param.Value = IntCropType; paramList.Add(param); SqlCommand cmd = new SqlCommand(); cmd = SQLHelper.CreateCommand("spDeleteMusterChitEntry", CommandType.StoredProcedure, paramList); identityParam = cmd.Parameters.Add("@scopeId", SqlDbType.Int, 4); statusParam = cmd.Parameters.Add("@state", SqlDbType.VarChar, 50); identityParam.Direction = ParameterDirection.ReturnValue; statusParam.Direction = ParameterDirection.Output; SQLHelper.ExecuteNonQuery(cmd); int trnScope = int.Parse(identityParam.Value.ToString()); Status = statusParam.Value.ToString(); cmd.Dispose(); return(Status); }
private bool ValidateData() { if (DtDate.Text.Trim().Length == 0) { ProjectFunctions.SpeakError("Invalid Date"); DtDate.Focus(); return(false); } if (DtDateforMonth.Text.Trim().Length == 0) { ProjectFunctions.SpeakError("Invalid Date Of Month"); DtDateforMonth.Focus(); return(false); } if (txtEmpCode.Text.Trim().Length == 0) { ProjectFunctions.SpeakError("Invalid EmpName"); txtEmpCode.Focus(); return(false); } if (txtEmpCodeDesc.Text.Trim().Length == 0) { ProjectFunctions.SpeakError("Invalid EmpName"); txtEmpCode.Focus(); return(false); } if (txtAmount.Text.Length == 0) { txtAmount.Text = "0"; } if (txtType.Text == "A" || txtType.Text == "C" || txtType.Text == "F") { } else { ProjectFunctions.SpeakError("Valid Values are Advance(A),Fine(F),Coupon(C)"); txtType.Focus(); return(false); } return(true); }
public String InsertBulkNotOffered(String strEmp) { String Status = ""; SqlParameter param = new SqlParameter(); SqlParameter statusParam = new SqlParameter(); SqlParameter identityParam = new SqlParameter(); List <SqlParameter> paramList = new List <SqlParameter>(); param = SQLHelper.CreateParameter("@Division", SqlDbType.VarChar, 50); param.Value = StrDivision; paramList.Add(param); param = SQLHelper.CreateParameter("@dateEntered", SqlDbType.DateTime); param.Value = Convert.ToDateTime(DtDate.ToShortDateString()); paramList.Add(param); param = SQLHelper.CreateParameter("@NOCode", SqlDbType.VarChar, 50); param.Value = StrNOCode; paramList.Add(param); param = SQLHelper.CreateParameter("@userId", SqlDbType.VarChar, 50); param.Value = StrUserId; paramList.Add(param); param = SQLHelper.CreateParameter("@emp", SqlDbType.VarChar, 50); param.Value = strEmp; paramList.Add(param); SqlCommand cmd = new SqlCommand(); cmd = SQLHelper.CreateCommand("spInsertDailyNotOfferedEmployeeWise", CommandType.StoredProcedure, paramList); identityParam = cmd.Parameters.Add("@scopeId", SqlDbType.Int, 4); statusParam = cmd.Parameters.Add("@state", SqlDbType.VarChar, 50); identityParam.Direction = ParameterDirection.ReturnValue; statusParam.Direction = ParameterDirection.Output; SQLHelper.ExecuteNonQuery(cmd); int trnScope = int.Parse(identityParam.Value.ToString()); Status = statusParam.Value.ToString(); cmd.Dispose(); return(Status); }
private void FrmAdvanceAddEdit_Load(object sender, EventArgs e) { SetMyControls(); if (S1 == "Add") { DtDate.Enabled = true; DtDate.EditValue = DateTime.Now; DtDateforMonth.EditValue = DateTime.Now; txtAdvanceNo.Text = GetNewLoanPassNo().PadLeft(6, '0'); txtType.Text = "A"; DtDate.Focus(); } if (S1 == "Edit") { DtDateforMonth.Enabled = false; DtDate.Enabled = false; txtType.Enabled = false; string str = "SELECT " + " ExMst.ExPostHead, " + " ExMst.ExVoucherType, " + " ExMst.ExVoucherNo, " + " ExMst.ExVoucherDt, " + " ExMst.ExNo, " + " ExMst.ExId, " + " ExMst.ExDate, " + " ExMst.ExEmpCode, " + " ExMst.ExAmt, " + " ExMst.ExTag, " + " ExMst.ExDatePost, " + " ExMst.ExLoadTag, " + " ExMst.ExEmpCCode, " + " ExMst.ExFedDate, " + " ExMst.ExLoadedDate, " + " empmst.EmpName, " + " actmst.AccName " + " FROM ExMst " + " LEFT OUTER JOIN EmpMST ON ExMst.ExEmpCode = empmst.EmpCode " + " LEFT OUTER JOIN ActMst ON ExMst.ExPostHead = actmst.AccCode " + " WHERE ExId='" + ExId + "';" + string.Empty; //var qr = " SELECT ExMst.ExPostHead, ExMst.ExVoucherType, ExMst.ExVoucherNo, ExMst.ExVoucherDt, ExMst.ExNo, ExMst.ExId, ExMst.ExDate, ExMst.ExEmpCode, ExMst.ExAmt, ExMst.ExTag, ExMst.ExDatePost, "; //qr = qr + " ExMst.ExLoadTag, ExMst.ExEmpCCode, ExMst.ExFedDate, ExMst.ExLoadedDate, empmst.EmpName, EmpEmplrRef.ERMDesc, actmst.AccName "; //qr = qr + " FROM ExMst LEFT OUTER JOIN "; //qr = qr + " empmst ON ExMst.ExEmpCode = empmst.EmpCode LEFT OUTER JOIN "; //qr = qr + " EmpEmplrRef ON ExMst.ExEmpCCode = EmpEmplrRef.ERMCode LEFT OUTER JOIN "; //qr = qr + " actmst ON ExMst.ExPostHead = actmst.AccCode "; //qr = qr + " WHERE ExId='" + ExId + "'"; PrintLogWin.PrintLog(str); var ds = ProjectFunctionsUtils.GetDataSet(str); try { txtAdvanceNo.Text = ds.Tables[0].Rows[0]["ExNo"].ToString(); DtDate.EditValue = Convert.ToDateTime(ds.Tables[0].Rows[0]["ExDate"]); DtDateforMonth.EditValue = Convert.ToDateTime(ds.Tables[0].Rows[0]["ExDatePost"]); txtEmpCode.Text = ds.Tables[0].Rows[0]["ExEmpCode"].ToString(); txtEmpCodeDesc.Text = ds.Tables[0].Rows[0]["EmpName"].ToString(); txtType.Text = ds.Tables[0].Rows[0]["ExTag"].ToString(); txtAmount.Text = ds.Tables[0].Rows[0]["ExAmt"].ToString(); } catch (Exception ex) { PrintLogWin.PrintLog(ex); } //GetBasicDetail(); } }
private bool ValidateData() { if (DtDate.Text.Trim().Length == 0) { DevExpress.XtraEditors.XtraMessageBox.Show("Invalid Date", "Save", MessageBoxButtons.OK, MessageBoxIcon.Hand); DtDate.Focus(); return(false); } if (Convert.ToDateTime(DtDate.Text).Date > DateTime.Now.Date) { DevExpress.XtraEditors.XtraMessageBox.Show("Wrong Date Selected", "Save", MessageBoxButtons.OK, MessageBoxIcon.Hand); DtDate.Focus(); return(false); } if (DtDateforMonth.Text.Trim().Length == 0) { DevExpress.XtraEditors.XtraMessageBox.Show("Invalid Date Of Month", "Save", MessageBoxButtons.OK, MessageBoxIcon.Hand); DtDateforMonth.Focus(); return(false); } if (txtEmpCode.Text.Trim().Length == 0) { DevExpress.XtraEditors.XtraMessageBox.Show("Invalid EmpName", "Save", MessageBoxButtons.OK, MessageBoxIcon.Hand); txtEmpCode.Focus(); return(false); } if (txtEmpCodeDesc.Text.Trim().Length == 0) { DevExpress.XtraEditors.XtraMessageBox.Show("Invalid EmpName", "Save", MessageBoxButtons.OK, MessageBoxIcon.Hand); txtEmpCode.Focus(); return(false); } if (S1 == "Add") { DataSet ds = ProjectFunctions.GetDataSet("Select * from ExMst Where ExEmpCode='" + txtEmpCode.Text + "' And ExDate='" + Convert.ToDateTime(DtDate.Text).ToString("yyyy-MM-dd") + "'"); if (ds.Tables[0].Rows.Count > 0) { DevExpress.XtraEditors.XtraMessageBox.Show("Advance Already Feeded", "Save", MessageBoxButtons.OK, MessageBoxIcon.Hand); txtEmpCode.Focus(); return(false); } } if (txtAmount.Text.Length == 0) { txtAmount.Text = "0"; } if (txtSalary.Text.Length == 0) { txtSalary.Text = "0"; } if (txtType.Text == "A" || txtType.Text == "C" || txtType.Text == "F" || txtType.Text == "L" | txtType.Text == "T") { } else { DevExpress.XtraEditors.XtraMessageBox.Show("Valid Values are Advance(a),Fine(F),Coupon(C),Lunch(L),Telephone(T)", "Save", MessageBoxButtons.OK, MessageBoxIcon.Hand); txtType.Focus(); return(false); } return(true); }
public String InsertMusterChitEntry() { String Status = ""; SqlParameter param = new SqlParameter(); SqlParameter statusParam = new SqlParameter(); SqlParameter identityParam = new SqlParameter(); List <SqlParameter> paramList = new List <SqlParameter>(); param = SQLHelper.CreateParameter("@dateEntered", SqlDbType.DateTime); param.Value = Convert.ToDateTime(DtDate.ToShortDateString()); paramList.Add(param); param = SQLHelper.CreateParameter("@divisionId", SqlDbType.VarChar, 50); param.Value = StrDivision; paramList.Add(param); param = SQLHelper.CreateParameter("@FieldId", SqlDbType.VarChar, 50); param.Value = StrField; paramList.Add(param); param = SQLHelper.CreateParameter("@MainACCode", SqlDbType.VarChar, 50); param.Value = StrACCode; paramList.Add(param); param = SQLHelper.CreateParameter("@GangNumber", SqlDbType.VarChar, 50); param.Value = StrGangNumber; paramList.Add(param); param = SQLHelper.CreateParameter("@ChitNumber", SqlDbType.VarChar, 50); param.Value = StrChitNo; paramList.Add(param); param = SQLHelper.CreateParameter("@NoOfEmployees", SqlDbType.Int); param.Value = IntEmpCount; paramList.Add(param); param = SQLHelper.CreateParameter("@userID", SqlDbType.VarChar, 50); param.Value = StrUser; paramList.Add(param); param = SQLHelper.CreateParameter("@labourType", SqlDbType.VarChar, 50); param.Value = StrLabourType; paramList.Add(param); param = SQLHelper.CreateParameter("@labourEstate", SqlDbType.VarChar, 50); param.Value = StrLabourEstate; paramList.Add(param); param = SQLHelper.CreateParameter("@labourDivision", SqlDbType.VarChar, 50); param.Value = StrLabourDivision; paramList.Add(param); param = SQLHelper.CreateParameter("@labourField", SqlDbType.VarChar, 50); param.Value = StrLabourField; paramList.Add(param); param = SQLHelper.CreateParameter("@Job", SqlDbType.VarChar, 50); param.Value = StrJobShortName; paramList.Add(param); param = SQLHelper.CreateParameter("@Crop", SqlDbType.Int); param.Value = IntCropType; paramList.Add(param); SqlCommand cmd = new SqlCommand(); cmd = SQLHelper.CreateCommand("spInsertMusterChitEntry", CommandType.StoredProcedure, paramList); identityParam = cmd.Parameters.Add("@scopeId", SqlDbType.Int, 4); statusParam = cmd.Parameters.Add("@state", SqlDbType.VarChar, 50); identityParam.Direction = ParameterDirection.ReturnValue; statusParam.Direction = ParameterDirection.Output; SQLHelper.ExecuteNonQuery(cmd); int trnScope = int.Parse(identityParam.Value.ToString()); Status = statusParam.Value.ToString(); cmd.Dispose(); return(Status); //SQLHelper.ExecuteNonQuery("INSERT INTO [dbo].[CHKMusterChit] ([DateEntered] ,[DivisionID] ,[FieldID] ,[MainAccountCode] ,[NoOfEmployees] ,[CreateDateTime] ,[UserID],[ChitNo],GangNumber) VALUES ('" + DtDate + "' ,'" + StrDivision + "' ,'" + StrField + "' ,'" + StrACCode + "' ,'" + IntEmpCount + "' ,getdate() ,'" + StrUser + "','" + StrChitNo + "','"+StrGangNumber+"')", CommandType.Text); }