//private void DataCaptureDynamicGrid()
        //{
        //    String ColumnName = "";
        //    try
        //    {
        //        DataCaptureManager manager = new DataCaptureManager();
        //        CustomList<DataCaptureConfiguration> FieldList = manager.GetAllDataCaptureConfigurationForDataCapture();

        //        String columnsCaption = "VID";

        //        String colModel = " " +
        //                        " { 'name': 'VID', 'key': true, 'hidden': true, 'width': 50, 'index': 'VID' } @" +
        //                        " { 'name': 'EmpKey', 'index': 'EmpKey','hidden': false, editable: true, width: 70} @" +
        //                        " { 'name': 'EmpName', 'index': 'EmpName','hidden': false, editable: false, width: 100} @" +
        //                        " { 'name': 'Department', 'index': 'Department','hidden': false, editable: false, width: 100} ";


        //        //if (FieldList.IsNotNull())
        //        //{
        //        //    int headCount = 1;
        //        //    foreach (DataCaptureConfiguration list in FieldList)
        //        //    {
        //        //        if (headCount == 1)
        //        //            HttpContext.Current.Session["Rate_HouseKeepingValueList1"] = manager.GetAllHouseKeepingValueForDropdown(list.Field);
        //        //        if (headCount == 2)
        //        //            HttpContext.Current.Session["Rate_HouseKeepingValueList2"] = manager.GetAllHouseKeepingValueForDropdown(list.Field);
        //        //        if (headCount == 3)
        //        //            HttpContext.Current.Session["Rate_HouseKeepingValueList3"] = manager.GetAllHouseKeepingValueForDropdown(list.Field);
        //        //        if (headCount == 4)
        //        //            HttpContext.Current.Session["Rate_HouseKeepingValueList4"] = manager.GetAllHouseKeepingValueForDropdown(list.Field);
        //        //        if (headCount == 5)
        //        //            HttpContext.Current.Session["Rate_HouseKeepingValueList5"] = manager.GetAllHouseKeepingValueForDropdown(list.Field);
        //        //        columnsCaption += "," + list.Field;
        //        //        colModel += "@ { 'name': 'Key" + headCount + "', 'index': 'Key" + headCount + "','hidden': false, editable: true, width: 70, editrules: { required: true }, edittype: 'select', formatter: 'select', editoptions: {style:'width:100%', value: GetDropDownSource('SessionVarName=Rate_HouseKeepingValueList" + headCount + "&NeedBlank=true&DataTextField=HKName&DataValueField=HKID')}} ";
        //        //        headCount++;
        //        //    }
        //        //}
        //        columnsCaption += ",EmpCode,EmpName,Department";
        //        //colModel += "@ { 'name': 'Rate', 'index': 'Rate','hidden': false, editable: true, width: 50, editrules: { required: true,number: true}} ";
        //        ColumnName = columnsCaption + "|" + colModel;


        //        HttpContext.Current.Response.Clear();
        //        HttpContext.Current.Response.ContentType = "text/plain";
        //        HttpContext.Current.Response.Write(ColumnName);
        //        HttpContext.Current.Response.Flush();
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}
        private void RateDynamicGrid()
        {
            String ColumnName = "";

            try
            {
                RateManager manager = new RateManager();
                CustomList <DataCaptureConfiguration> FieldList = manager.GetAllDataCaptureConfigurationForRate();

                String columnsCaption = "VID";

                String colModel = " " +
                                  " { 'name': 'VID', 'key': true, 'hidden': true, 'width': 50, 'index': 'VID' }";


                if (FieldList.IsNotNull())
                {
                    int headCount = 1;
                    foreach (DataCaptureConfiguration list in FieldList)
                    {
                        if (headCount == 1)
                        {
                            HttpContext.Current.Session["Rate_HouseKeepingValueList1"] = manager.GetAllHouseKeepingValueForDropdown(list.Field);
                        }
                        if (headCount == 2)
                        {
                            HttpContext.Current.Session["Rate_HouseKeepingValueList2"] = manager.GetAllHouseKeepingValueForDropdown(list.Field);
                        }
                        if (headCount == 3)
                        {
                            HttpContext.Current.Session["Rate_HouseKeepingValueList3"] = manager.GetAllHouseKeepingValueForDropdown(list.Field);
                        }
                        if (headCount == 4)
                        {
                            HttpContext.Current.Session["Rate_HouseKeepingValueList4"] = manager.GetAllHouseKeepingValueForDropdown(list.Field);
                        }
                        if (headCount == 5)
                        {
                            HttpContext.Current.Session["Rate_HouseKeepingValueList5"] = manager.GetAllHouseKeepingValueForDropdown(list.Field);
                        }
                        columnsCaption += "," + list.Field;
                        colModel       += "@ { 'name': 'Key" + headCount + "', 'index': 'Key" + headCount + "','hidden': false, editable: true, width: 70, editrules: { required: true }, edittype: 'select', formatter: 'select', editoptions: {style:'width:100%', value: GetDropDownSource('SessionVarName=Rate_HouseKeepingValueList" + headCount + "&NeedBlank=true&DataTextField=HKName&DataValueField=HKID')}} ";
                        headCount++;
                    }
                }
                columnsCaption += ",Rate";
                colModel       += "@ { 'name': 'Rate', 'index': 'Rate','hidden': false, editable: true, width: 50, editrules: { required: true,number: true}} ";
                ColumnName      = columnsCaption + "|" + colModel;


                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.ContentType = "text/plain";
                HttpContext.Current.Response.Write(ColumnName);
                HttpContext.Current.Response.Flush();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
 private void ClearControls()
 {
     try
     {
         InitializeSession();
         CustomList <DataCaptureConfiguration> FieldList = manager.GetAllDataCaptureConfigurationForRate();
         int count = 1;
         foreach (DataCaptureConfiguration dCC in FieldList)
         {
             if (count == 1)
             {
                 HouseKeepingValueList1 = new CustomList <HouseKeepingValue>();
                 count++;
             }
             else if (count == 2)
             {
                 HouseKeepingValueList2 = new CustomList <HouseKeepingValue>();
                 count++;
             }
             else if (count == 3)
             {
                 HouseKeepingValueList3 = new CustomList <HouseKeepingValue>();
                 count++;
             }
             else if (count == 4)
             {
                 HouseKeepingValueList4 = new CustomList <HouseKeepingValue>();
                 count++;
             }
             else if (count == 5)
             {
                 HouseKeepingValueList5 = new CustomList <HouseKeepingValue>();
                 count++;
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }