Esempio n. 1
0
        public JsonResult SaveTrainingAssesmentEntry(string ddlIdNo, string empEvType, string empEvKal, string trainingDate, string assesmentDate, string prmIsAssessmentCompleted, string txtUnitManagerMontobbo, string chkbxVal, string aprovedDate, string assesmentOptionId, string assesmentOptionCriteria, string weight, string pPurboPNo, string prmIsAssessmentSelectedByERPData, string userLogin, string insertERPData, Int32 gridLength, string rowWiseRemarks)
        {
            string successMessage = string.Empty;

            objLoginHelper = (LoginHelper)Session["LogInInformation"];

            string prmLocationCode = objLoginHelper.LogInForUnitCode.ToString();
            string prmUserName     = objLoginHelper.LogInID.ToString();



            ArrayList arrCriteria       = new ArrayList();
            ArrayList arrCriteriaScore  = new ArrayList();
            ArrayList arrCriteriaBangla = new ArrayList();

            string[] assesmentOptionCriteriaArry = assesmentOptionCriteria.Split('_');
            for (int k = 0; k < assesmentOptionCriteriaArry.Length; k++)
            {
                int    optionIDone   = k + 1;
                string optionID      = optionIDone.ToString();
                string criteriaValue = assesmentOptionCriteriaArry[k].ToString();



                if (criteriaValue != "")
                {
                    List <AssesmentCriteriaNScore> lstAssesmentCriteriaNScore = new List <AssesmentCriteriaNScore>();
                    lstAssesmentCriteriaNScore = hrmsData.ReadAssesmentCriteriaNScore(optionID, criteriaValue);

                    foreach (AssesmentCriteriaNScore emp in lstAssesmentCriteriaNScore)
                    {
                        // arrCriteriaBangla.Add(new { AssessmentCriteriaOptionNameInEnglish = emp.AssessmentCriteriaOptionNameInEnglish });
                        arrCriteria.Add(new { EvaluationCriteriaOptionID = emp.EvaluationCriteriaOptionID });
                        arrCriteriaScore.Add(new { EvaluationCriteriaScore = emp.EvaluationCriteriaScore });
                    }
                }
            }


            string crID    = "";
            string crArrID = "";

            string crScore    = "";
            string crArrScore = "";

            for (int k = 0; k < arrCriteria.Count; k++)
            {
                crID = arrCriteria[k].ToString();
                int abd = crID.IndexOf('=');

                string cdf = crID.Substring(abd + 1);
                crArrID = crArrID + cdf.Substring(0, cdf.Length - 1).Trim() + "_";
            }

            for (int k = 0; k < arrCriteriaScore.Count; k++)
            {
                crScore = arrCriteriaScore[k].ToString();
                int abd = crScore.IndexOf('=');

                string cdf = crScore.Substring(abd + 1);
                crArrScore = crArrScore + cdf.Substring(0, cdf.Length - 1).Trim() + "_";
            }

            try
            {
                //if (objLoginHelper.Location == Helper.Zone || objLoginHelper.Location == Helper.HeadOffice)
                //{

                //ddlIdNo: ddlIdNo, empEvType: empEvType,empEvKal:empEvKal, trainingDate: trainingDate, assesmentDate: assesmentDate, prmIsAssessmentCompleted: prmIsAssessmentCompleted, txtUnitManagerMontobbo: txtUnitManagerMontobbo, chkbxVal: chkbxVal, aprovedDate: aprovedDate, assesmentOptionId: assesmentOptionId, assesmentOptionCriteria: assesmentOptionCriteria, weight: weight, pPurboPNo: pPurboPNo, prmIsAssessmentSelectedByERPData: prmIsAssessmentSelectedByERPData, userLogin: userLogin, insertData: insertData, gridLength: rowsCount
                successMessage = hrmsData.SaveTrainingAssesmentEntry(prmLocationCode, ddlIdNo, empEvType, empEvKal, trainingDate, assesmentDate, prmIsAssessmentCompleted, txtUnitManagerMontobbo, chkbxVal, aprovedDate, crArrID, crArrScore, weight, pPurboPNo, prmIsAssessmentSelectedByERPData, userLogin, insertERPData, rowWiseRemarks);

                return(new JsonResult {
                    Data = ExceptionHelper.ExceptionMessage(string.Empty)
                });
            }
            catch (Exception ex)
            {
                return(new JsonResult
                {
                    Data = ExceptionHelper.ExceptionMessage(ex)
                });
            }
        }