Example #1
0
        public string InsertUpdate(string DesgCode, string DesgDesc, string AddEditTag)
        {
            RepGen            reposGen = new RepGen();
            DynamicParameters param    = new DynamicParameters();

            param.Add("@DesgCode", DesgCode);
            param.Add("@DesgDesc", DesgDesc);
            param.Add("@AddEditTag", AddEditTag);

            return(reposGen.ExecuteNonQuery_SP("sp_DesignationAddUpdate", param));
        }
Example #2
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            try
            {
                int serial_id = ConvertTo.IntVal(txtEmpCode.Tag);

                var               str      = "sp_GatePassData_AddEdit";
                RepGen            reposGen = new RepGen();
                DynamicParameters param    = new DynamicParameters();
                param.Add("@serial_id", serial_id);
                param.Add("@entry_date", ConvertTo.DateFormatDb(DateTime.Now));//Convert.ToDateTime(DateTime.Now).ToString("yyyy-MM-dd")
                param.Add("@status_id", txtStatusCode.Text);
                param.Add("@employee_code", txtEmpCode.Text);
                param.Add("@attendance_date", ConvertTo.DateFormatDb(ConvertTo.DateTimeVal(DtDate.Text)));//Convert.ToDateTime(DtDate.Text).ToString("yyyy-MM-dd")
                param.Add("@attendance_out", timeEdit_Time_Out.Text);
                param.Add("@attendance_in", timeEdit_Time_In.Text);

                param.Add("@output", dbType: DbType.Int32, direction: ParameterDirection.Output);
                param.Add("@Returnvalue", dbType: DbType.Int32, direction: ParameterDirection.ReturnValue);

                string intResult = reposGen.ExecuteNonQuery_SP(str, param);
                if (intResult.Equals("0"))
                {
                    int outputVal = param.Get <int>("@output");
                    int returnVal = param.Get <int>("@Returnvalue");

                    PrintLogWin.PrintLog("outputVal => " + outputVal);
                    PrintLogWin.PrintLog("returnVal => " + returnVal);

                    txtEmpCode.Tag = outputVal;
                    ProjectFunctions.SpeakError("Record has been saved");
                    LoadGatePassDataGrid();
                }
                else
                {
                    ProjectFunctions.SpeakError("Error in save record.");
                    PrintLogWin.PrintLog(intResult);
                }
                //this.Close();
            }
            catch (Exception ex)
            {
                ProjectFunctions.SpeakError("Error in save record.");
                PrintLogWin.PrintLog(ex);
            }
        }