Пример #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ICustomList CustomManager;

            try
            {
                CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
                DataTable   DTupdateprior = new DataTable();
                ICustomList PriorManager  = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
                if (btnSave.Text == "Save")
                {
                    int RowsAffected = CustomManager.SaveUpdateVillageChairperson(Convert.ToInt32(ddlRegion.SelectedItem.Value), Convert.ToInt32(ddDistric.SelectedItem.Value), Convert.ToInt32(ddWard.SelectedItem.Value), Convert.ToInt32(ddlVillage.SelectedItem.Value), txtChairPerson.Text, Convert.ToInt32(Session["AppUserId"]), 1);
                }
                else if (btnSave.Text == "Update")
                {
                    int RowsAffected = CustomManager.SaveUpdateVillageChairperson(Convert.ToInt32(ddlRegion.SelectedItem.Value), Convert.ToInt32(ddDistric.SelectedItem.Value), Convert.ToInt32(ddWard.SelectedItem.Value), Convert.ToInt32(ddlVillage.SelectedItem.Value), txtChairPerson.Text, Convert.ToInt32(Session["AppUserId"]), 2);
                }
                string theUrl = "frmAdmin_CustomItems.aspx";
                Response.Redirect(theUrl);
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
            finally
            {
                CustomManager = null;
            }
        }
    private void SelectedBindBlock(int depth, int level)
    {
        try
        {
            ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
            DataSet     theDSList     = CustomManager.GetICDList();
            foreach (DataRow theDR1 in theDSList.Tables[0].Rows)
            {
                ICDChapterCode       = new TreeNode();
                ICDChapterCode.Text  = Convert.ToString(theDR1["ChapterName"]);
                ICDChapterCode.Value = Convert.ToString(theDR1["ChapterCode"]);
                foreach (DataRow theDR2 in theDSList.Tables[1].Rows)
                {
                    if (depth == Convert.ToInt32(theDR1["ChapterId"]))
                    {
                        if (Convert.ToInt32(theDR1["ChapterId"]) == Convert.ToInt32(theDR2["ChapterId"]) && level == 0)
                        {
                            ICDBlockCode       = new TreeNode();
                            ICDBlockCode.Text  = theDR2["BlockCode"] + " " + theDR2["BlockName"];
                            ICDBlockCode.Value = theDR2["BlockId"].ToString();
                            ICDChapterCode.ChildNodes.Add(ICDBlockCode);
                        }
                        ICDChapterCode.Expand();
                    }
                }
                TVICD10.Nodes.Add(ICDChapterCode);
            }
            TVICD10.ShowLines  = true;
            TVICD10.NodeIndent = 5;
            TVICD10.ExpandAll();
        }
        catch { }

        finally { }
    }
Пример #3
0
    private void GetData()
    {
        ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
        DataTable   theDT         = CustomManager.GetCustomMasterDetails(ViewState["TableName"].ToString(), Convert.ToInt32(ViewState["Id"]), Convert.ToInt32(Session["SystemId"]));

        txtName.Text  = theDT.Rows[0]["Name"].ToString();
        txtSeqNo.Text = theDT.Rows[0]["SRNO"].ToString();
        if (ViewState["TableName"].ToString() == "Frequency")
        {
            if (theDT.Rows[0]["multiplier"].ToString() != "0")
            {
                txtmultiplier.Text = theDT.Rows[0]["multiplier"].ToString();
            }
            if (theDT.Rows[0]["multiplier"].ToString() != "0")
            {
                rdinteger.Checked = true;
            }
            else
            {
                rdnomultiplier.Checked = true;
            }
        }
        if (theDT.Rows[0]["DeleteFlag"].ToString() != "")
        {
            if (Convert.ToBoolean(Convert.ToInt32(theDT.Rows[0]["DeleteFlag"])) == true)
            {
                ddStatus.SelectedValue = "1";
            }
        }
    }
 /// <summary>
 /// Gets an List and adds the values ​​of the List to the list if there is no item like it.
 /// </summary>
 /// <param name="collection">Аn List from which it takes values.</param>
 public void AddRange(ICustomList <T> collection)
 {
     foreach (var item in (CustomList <T>)collection)
     {
         Add(item);
     }
 }
    private void BindList()
    {
        try
        {
            ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
            DataSet     theDSList     = CustomManager.GetICDList();
            DataRow[]   ChapterRow    = theDSList.Tables[4].Select("FieldId=" + Request.QueryString["Param"].Substring(4).ToString() + "");
            foreach (DataRow theDR1 in ChapterRow)
            {
                blnPartialsearch     = true;
                blnfullsearch        = false;
                ICDChapterCode       = new TreeNode();
                ICDChapterCode.Text  = Convert.ToString(theDR1["ChapterName"]);
                ICDChapterCode.Value = Convert.ToString(theDR1["ChapterCode"]);
                TVICD10.Nodes.Add(ICDChapterCode);
            }
            TVICD10.ShowLines  = true;
            TVICD10.NodeIndent = 5;
            //CollapseAll();
            //foreach (DataRow theDR1 in theDSList.Tables[0].Rows)
            //{
            //    ICDChapterCode = new TreeNode();
            //    ICDChapterCode.Text = Convert.ToString(theDR1["ChapterName"]);
            //    ICDChapterCode.Value = Convert.ToString(theDR1["ChapterCode"]);
            //    TVICD10.Nodes.Add(ICDChapterCode);
            //}
            //TVICD10.ShowLines = true;
            //TVICD10.NodeIndent = 5;
        }
        catch { }

        finally { }
    }
Пример #6
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (FieldValidation() == false)
            {
                return;
            }
            String Id          = Convert.ToString(Request.QueryString["SelectedId"]);
            int    DiseaseFlag = 0;

            if (Convert.ToString(Request.QueryString["TableName"]) == "HivDisease")
            {
                DiseaseFlag = 1;
            }
            else if (Convert.ToString(Request.QueryString["TableName"]) == "Symptom")
            {
                DiseaseFlag = 0;
            }
            Hashtable   theHT         = Disease_SymptomDetails(Id, DiseaseFlag);
            ArrayList   theAL         = ICDCodeforModule();
            ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

            if (Id == null)
            {
                DataTable RowsAffected = CustomManager.SaveICDCodeRecord(theHT, theAL);
                string    Url          = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}&ModId={7}", "frmAdmin_CustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"].ToString(), ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString(), ViewState["CCID"].ToString(), ViewState["ModuleId"].ToString());
                Response.Redirect(Url);
            }
            else
            {
                int    RowsAffected = CustomManager.UpdateICDCodeRecord(Id, theHT, theAL);
                string Url          = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}&ModId={7}", "frmAdmin_CustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"].ToString(), ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString(), ViewState["CCID"].ToString(), ViewState["ModuleId"].ToString());
                Response.Redirect(Url);
            }
        }
Пример #7
0
    private void Init_Form()
    {
        if (ViewState["TableName"].ToString() != "HivDisease")
        {
            lblHeader.Text = ViewState["ListName"].ToString();
            ////////// Done by Sanjay on 19th Sept 2006  ////////////////////////////////////////
            ////////// For all the Custom List the ListName field of XML file will be Used //////
            ////////if (Convert.ToInt32(ViewState["CategoryId"]) > 0)
            //////// lblHeader.Text = ViewState["ListName"].ToString();
            /////////////////////////////////////////////////////////////////////////////////////
        }
        else
        {
            lblHeader.Text = "OIs or AIDS Defining Illnesses";
        }

        ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
        DataTable   theDT         = CustomManager.GetCustomList(ViewState["TableName"].ToString(), Convert.ToInt32(ViewState["CategoryId"]), Convert.ToInt32(Session["SystemId"]));

        if (ViewState["gridSource"] == null)
        {
            ViewState["gridSource"]        = theDT;
            ViewState["gridSortDirection"] = "Desc";
        }

        grdCustom.DataSource = theDT;
        Bind_Grid();
    }
Пример #8
0
    private void BindList()
    {
        try
        {
            ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
            DataSet     theDSList     = CustomManager.GetICDList();
            foreach (DataRow theDR1 in theDSList.Tables[0].Rows)
            {
                ICDChapterCode       = new TreeNode();
                ICDChapterCode.Text  = Convert.ToString(theDR1["ChapterName"]);
                ICDChapterCode.Value = Convert.ToString(theDR1["ChapterCode"]);
                //foreach (DataRow theDR2 in theDSList.Tables[1].Rows)
                //{
                //    if (Convert.ToInt32(theDR1["ChapterId"]) == Convert.ToInt32(theDR2["ChapterId"]))
                //    {
                //        ICDBlockCode = new TreeNode();
                //        ICDBlockCode.Text = theDR2["BlockCode"] + " " + theDR2["BlockName"];
                //        ICDBlockCode.Value = theDR2["BlockId"].ToString();
                //        ICDChapterCode.ChildNodes.Add(ICDBlockCode);
                //    }
                //}
                TVICD10.Nodes.Add(ICDChapterCode);
            }
            TVICD10.ShowLines  = true;
            TVICD10.NodeIndent = 5;
            TVICD10.CollapseAll();
        }
        catch { }

        finally { }
    }
Пример #9
0
    /////////////////////////////////////////////////////////////////////
    // Code Written By   : Sanjay Rana
    // Written Date      : 25th Aug 2006
    // Modification Date :
    // Description       : Custom Item List
    //
    /// /////////////////////////////////////////////////////////////////
    #region "User Functions"
    private void BindGrid()
    {
        IQCareUtils theUtil = new IQCareUtils();
        DataSet     dscustomiseList;
        string      filePath = Server.MapPath("~/XMLFiles/customizelist.xml");

        dscustomiseList = new DataSet();
        dscustomiseList.ReadXml(filePath);
        DataView theDV = new DataView(dscustomiseList.Tables[0]);

        theDV.RowFilter = "SystemId=" + Session["SystemId"].ToString() + " or SystemId=0";
        DataTable theXMLDT = theUtil.CreateTableFromDataView(theDV);

        ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
        DataTable   theDT         = CustomManager.GetCustomFieldList(Convert.ToInt32(Session["SystemId"]), Convert.ToInt32(Session["AppLocationId"]));

        if (theDT != null && theDT.Rows.Count > 0)
        {
            theXMLDT.Merge(theDT);
        }
        theDV      = new DataView(theXMLDT);
        theDV.Sort = "Listname asc";
        grdCustomizeItems.DataSource = theUtil.CreateTableFromDataView(theDV);
        grdCustomizeItems.DataBind();
        grdCustomizeItems.Columns[1].Visible = false;
        grdCustomizeItems.Columns[2].Visible = false;
        grdCustomizeItems.Columns[3].Visible = false;
        grdCustomizeItems.Columns[4].Visible = false;
        grdCustomizeItems.Columns[5].Visible = false;
    }
    private void Init_Form()
    {
        lblHeader.Text = ViewState["ListName"].ToString();

        ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
        DataTable   theDT         = CustomManager.GetCustomList(ViewState["TableName"].ToString(), Convert.ToInt32(ViewState["CategoryId"]), Convert.ToInt32(Session["SystemId"]));

        if (ViewState["ModuleId"] != null)
        {
            if (Convert.ToInt32(ViewState["ModuleId"]) > 0 && ViewState["TableName"].ToString().ToUpper() == "DECODE")
            {
                IQCareUtils theUtilsCF = new IQCareUtils();
                DataView    theDVCF    = new DataView(theDT);
                theDVCF.RowFilter = "ModuleId in(0," + Convert.ToInt32(ViewState["ModuleId"]) + ")";
                theDT             = new DataTable();
                theDT             = (DataTable)theUtilsCF.CreateTableFromDataView(theDVCF);
            }
        }
        if (ViewState["gridSource"] == null)
        {
            ViewState["gridSource"]        = theDT;
            ViewState["gridSortDirection"] = "Desc";
        }

        grdCustom.DataSource = theDT;
        Bind_Grid();
    }
Пример #11
0
    protected void TVICD10_SelectedNodeChanged(object sender, EventArgs e)
    {
        btnAdd.Enabled = false;

        Object SelectedValue = ((TreeView)sender).SelectedValue;

        ((TreeView)sender).SelectedNodeStyle.ForeColor = System.Drawing.Color.Red;
        if (((TreeView)sender).SelectedNode.Depth == 0)
        {
            TVICD10.Nodes.Clear();
            SelectedBindBlock(Convert.ToInt32(SelectedValue), 0);
            //TVICD10.SelectedNodeStyle.Font.Underline = true;
        }
        else if (((TreeView)sender).SelectedNode.Depth == 1)
        {
            ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
            DataSet     theDSList     = CustomManager.GetICDList();
            DataView    theDV         = new DataView(theDSList.Tables[1]);
            String[]    Id            = SelectedValue.ToString().Split('^');
            txtvalue.Text   = SelectedValue.ToString() + "^" + ((TreeView)sender).SelectedNode.Depth;
            theDV.RowFilter = "BlockId=" + Id[0].ToString();
            DataTable theDT = theDV.ToTable();
            TVICD10.Nodes.Clear();
            //txtvalue.Text = theDT.Rows[0]["BlockId"] + "^" + theDT.Rows[0]["BlockCode"] + " " + theDT.Rows[0]["BlockName"] + "^" + "1";
            SelectedBindSubBlock(Convert.ToInt32(Id[0]), 1, Convert.ToInt32(theDT.Rows[0][1]));
            txtvalue.Text = theDT.Rows[0]["BlockId"] + "^" + theDT.Rows[0]["BlockCode"] + " " + theDT.Rows[0]["BlockName"] + "^" + "1";
            //TVICD10.SelectedNodeStyle.Font.Underline = true;
        }
        else if (((TreeView)sender).SelectedNode.Depth == 2)
        {
            ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
            DataSet     theDSList     = CustomManager.GetICDList();
            DataView    theDV         = new DataView(theDSList.Tables[2]);
            String[]    Id            = SelectedValue.ToString().Split('^');
            theDV.RowFilter = "SubBlockId=" + Id[0].ToString();
            DataTable theDT = theDV.ToTable();
            theDV           = new DataView(theDSList.Tables[1]);
            theDV.RowFilter = "BlockId=" + Convert.ToString(theDT.Rows[0][0]);
            DataTable theDT1 = theDV.ToTable();
            TVICD10.Nodes.Clear();
            SelectedBindICDCodes(Convert.ToInt32(Id[0]), 2, Convert.ToInt32(theDT.Rows[0][0]), Convert.ToInt32(theDT1.Rows[0][1]));
            txtvalue.Text = theDT.Rows[0]["SubBlockId"] + "^" + theDT.Rows[0]["SubBlockCode"] + " " + theDT.Rows[0]["SubBlockName"] + "^" + "2";

            //txtvalue.Text = theDT.Rows[0]["SubBlockId"] + "^" + theDT.Rows[0]["SubBlockCode"] + " " + theDT.Rows[0]["SubBlockName"] + "^"+"2";
            //TVICD10.SelectedNodeStyle.Font.Underline = true;
            //TVICD10.SelectedNodeStyle.ForeColor = System.Drawing.Color.Red;
        }
        else if (((TreeView)sender).SelectedNode.Depth == 3)
        {
            txtvalue.Text = SelectedValue.ToString() + "^" + ((TreeView)sender).SelectedNode.Depth;
            //TVICD10.SelectedNodeStyle.Font.Underline = true;
            //TVICD10.SelectedNodeStyle.ForeColor = System.Drawing.Color.Red;
        }
        if (txtvalue.Text != "")
        {
            btnAdd.Enabled = true;
        }
        //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ScrollToSelectedNode", "ScrollToSelectedNode();", true);
    }
Пример #12
0
        public Engine(IReader reader, IWriter writer)
        {
            this.reader = reader;
            this.writer = writer;

            this.list           = new CustomList <string>();
            this.commandFactory = new GenericFactory();
        }
Пример #13
0
        private void GetSelectedBindICDCodes(int SelectedValue, int Current_level, int BlockId, int ChapterId)
        {
            try
            {
                int         level_0       = 0;
                int         level_1       = 1;
                ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
                DataSet     theDSList     = CustomManager.GetICDList();
                foreach (DataRow theDR1 in theDSList.Tables[0].Rows)
                {
                    ICDChapterCode       = new TreeNode();
                    ICDChapterCode.Text  = Convert.ToString(theDR1["ChapterName"]);
                    ICDChapterCode.Value = Convert.ToString(theDR1["ChapterCode"]);
                    foreach (DataRow theDR2 in theDSList.Tables[1].Rows)
                    {
                        if (Convert.ToInt32(theDR1["ChapterId"]) == Convert.ToInt32(theDR2["ChapterId"]) && ChapterId == Convert.ToInt32(theDR2["ChapterId"]) && level_0 == 0)
                        {
                            ICDBlockCode       = new TreeNode();
                            ICDBlockCode.Text  = theDR2["BlockCode"] + " " + theDR2["BlockName"];
                            ICDBlockCode.Value = theDR2["BlockId"].ToString();
                            foreach (DataRow theDR3 in theDSList.Tables[2].Rows)
                            {
                                if (Convert.ToInt32(ICDBlockCode.Value) == Convert.ToInt32(theDR3["BlockId"]) && BlockId == Convert.ToInt32(ICDBlockCode.Value) && level_1 == 1)
                                {
                                    ICDSubBlockCode       = new TreeNode();
                                    ICDSubBlockCode.Text  = theDR3["SubBlockCode"] + " " + theDR3["SubBlockName"];
                                    ICDSubBlockCode.Value = Convert.ToString(theDR3["SubBlockId"]);
                                    foreach (DataRow theDR4 in theDSList.Tables[3].Rows)
                                    {
                                        ICDCode10       = new TreeNode();
                                        ICDCode10.Text  = theDR4["ICDCode"] + " " + theDR4["ICDCodeName"];
                                        ICDCode10.Value = Convert.ToString(theDR4["ID"] + "-" + theDR4["ICDCode"] + " " + theDR4["ICDCodeName"]);
                                        //ICDCode10.Value = Convert.ToString(theDR4["ID"]);
                                        if (Convert.ToInt32(ICDSubBlockCode.Value) == Convert.ToInt32(theDR4["SubBlockId"]) && SelectedValue == Convert.ToInt32(theDR4["ID"]) && Current_level == 2)
                                        {
                                            ICDCode10.Selected = true;
                                            ICDSubBlockCode.ChildNodes.Add(ICDCode10);
                                        }
                                    }
                                    ICDBlockCode.ChildNodes.Add(ICDSubBlockCode);
                                }
                            }
                            ICDChapterCode.ChildNodes.Add(ICDBlockCode);
                        }
                    }
                    TVICD10.Nodes.Add(ICDChapterCode);
                }
                TVICD10.SelectedNodeStyle.Font.Underline = true;
                TVICD10.SelectedNodeStyle.ForeColor      = System.Drawing.Color.Red;
                TVICD10.ShowLines  = true;
                TVICD10.NodeIndent = 5;
                TVICD10.ExpandAll();
            }
            catch { }

            finally { }
        }
Пример #14
0
        public static void Sort <T>(ICustomList <T> inputList)
            where T : IComparable <T>
        {
            var sorted = inputList.OrderBy(e => e).ToList();

            for (var i = 0; i < sorted.Count; i++)
            {
                inputList[i] = sorted[i];
            }
        }
Пример #15
0
        public ApiResponse Ok <T>(ICustomList <T> list) where T : class
        {
            StatusCode = HttpStatusCode.OK;
            Result     = list;
            TotalCount = list.TotalCount;
            Message    = _localizationService.GetValue(DefaultResponseMessages.SuccessMessage);

            //_logger.LogInformation(Message, Result);
            return(this);
        }
Пример #16
0
        public void ExecuteCmd(string[] cmdArgs)
        {
            var    command = cmdArgs[0];
            string element;
            int    index1;
            int    index2;

            switch (command)
            {
            case "Add":
                element = cmdArgs[1];
                this.CustomList.Add(element);
                break;

            case "Remove":
                index1 = int.Parse(cmdArgs[1]);
                this.CustomList.Remove(index1);
                break;

            case "Contains":
                element = cmdArgs[1];
                Console.WriteLine(this.CustomList.Contains(element));
                break;

            case "Swap":
                index1 = int.Parse(cmdArgs[1]);
                index2 = int.Parse(cmdArgs[2]);
                this.CustomList.Swap(index1, index2);
                break;

            case "Greater":
                element = cmdArgs[1];
                Console.WriteLine(this.CustomList.CountGreaterThan(element));
                break;

            case "Max":
                Console.WriteLine(this.CustomList.Max());
                break;

            case "Min":
                Console.WriteLine(this.CustomList.Min());
                break;

            case "Sort":
                this.CustomList = Sorter.Sort(this.CustomList);
                break;

            case "Print":
                foreach (var item in this.CustomList)
                {
                    Console.WriteLine(item);
                }
                break;
            }
        }
Пример #17
0
        void TraceList <TElement>(ICustomList <TElement> list) where TElement : struct
        {
            //Trace.WriteLine($"{String.Join("\r", list.Enumerate())}\r");

            foreach (var t in list.Enumerate())
            {
                Trace.WriteLine(t);
            }

            Trace.WriteLine(String.Empty);
        }
Пример #18
0
    protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)
    {
        ICustomList CustomManager;

        CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
        DataTable   DTFindRecord = new DataTable();
        ICustomList PriorManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

        DTFindRecord = CustomManager.GetCustomMasterLinkRecord(ViewState["TableName"].ToString(), Convert.ToInt32(ddlRegion.SelectedItem.Value));
        DataColumn[] thePKey = new DataColumn[2];
        thePKey[0] = DTFindRecord.Columns[0];
        thePKey[1] = DTFindRecord.Columns[2];
        DTFindRecord.PrimaryKey = thePKey;
        ViewState["GrdData"]    = DTFindRecord;
        Bind_Grid(DTFindRecord);

        //if (DTFindRecord.Rows.Count > 0)
        //{
        //    //FillSelected();
        //    for (int j = 0; j < ddDistrict.Items.Count; j++)
        //    {

        //        ddDistrict.Items[j].Selected = false;


        //    }
        //    for (int i = 0; i < DTFindRecord.Rows.Count; i++)
        //    {
        //        for (int j = 0; j < ddDistrict.Items.Count; j++)
        //        {
        //            if (ddDistrict.Items[j].Value == DTFindRecord.Rows[i][1].ToString())
        //            {
        //                btnSave.Text = "Update";
        //                ddDistrict.Items[j].Selected = true;

        //            }
        //        }
        //    }
        //}
        //else
        //{
        //    for (int j = 0; j < ddDistrict.Items.Count; j++)
        //    {
        //      btnSave.Text = "Save";
        //      ddDistrict.Items[j].Selected = false;


        //    }
        //    //FillNonSelectd();
        //}
    }
        private void GetData()
        {
            ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
            DataTable   theDT         = CustomManager.GetCustomMasterDetails(ViewState["TableName"].ToString(), Convert.ToInt32(ViewState["Id"]), Convert.ToInt32(Session["SystemId"]));

            txtName.Text  = theDT.Rows[0]["Name"].ToString();
            txtSeqNo.Text = theDT.Rows[0]["SRNO"].ToString();
            txtcode.Text  = theDT.Rows[0]["Code"].ToString();

            if (Convert.ToBoolean(Convert.ToInt32(theDT.Rows[0]["DeleteFlag"])) == true)
            {
                ddStatus.SelectedValue = "1";
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ICustomList CustomManager;

            try
            {
                if (Convert.ToInt32(ddlRegion.SelectedValue) <= 0)
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["Control"] = lblfrom.Text;
                    IQCareMsgBox.Show("BlankDropDown", theBuilder, this);
                    ddlRegion.Focus();
                    return;
                }

                if (Convert.ToInt32(ddDistrict.SelectedValue) <= 0)
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["Control"] = lblto.Text;
                    IQCareMsgBox.Show("BlankDropDown", theBuilder, this);
                    ddDistrict.Focus();
                    return;
                }
                CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
                DataTable   DTupdateprior = new DataTable();
                ICustomList PriorManager  = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

                int       DeleteCount = CustomManager.DeleteCustomMasterLinkRecord(ViewState["TableName"].ToString(), Convert.ToInt32(ddlRegion.SelectedItem.Value));
                DataTable theDT       = (DataTable)ViewState["GrdData"];
                for (int i = 0; i < theDT.Rows.Count; i++)
                {
                    int RowsAffected = CustomManager.SaveUpdateCustomMasterLinkRecord(ViewState["TableName"].ToString(), Convert.ToInt32(theDT.Rows[i][0]), Convert.ToInt32(theDT.Rows[i][2]), Convert.ToInt32(Session["AppUserId"]));
                }

                string theUrl = "frmAdmin_PMTCT_CustomItems.aspx";
                Response.Redirect(theUrl);
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
                return;
            }
            finally
            {
                CustomManager = null;
            }
        }
Пример #21
0
    private static void ExecuteCommand(ICustomList <string> customList, string command)
    {
        var commandArgs = command.Split(' ');
        var commandName = commandArgs[0];
        var args        = commandArgs.Skip(1).ToArray();

        switch (commandName)
        {
        case "Add":
            customList.Add(args[0]);
            break;

        case "Remove":
            customList.Remove(int.Parse(args[0]));
            break;

        case "Contains":
            Console.WriteLine(customList.Contains(args[0]));
            break;

        case "Swap":
            customList.Swap(int.Parse(args[0]), int.Parse(args[1]));
            break;

        case "Greater":
            Console.WriteLine(customList.CountGreaterThan(args[0]));
            break;

        case "Max":
            Console.WriteLine(customList.Max());
            break;

        case "Min":
            Console.WriteLine(customList.Min());
            break;

        case "Print":
            Console.WriteLine(customList);
            break;

        case "Sort":
            customList.Sort();
            break;

        default:
            break;
        }
    }
Пример #22
0
    private void Init_Form()
    {
        if (ViewState["TableName"].ToString() != "HivDisease")
        {
            lblHeader.Text = ViewState["ListName"].ToString();
            ////////// Done by Sanjay on 19th Sept 2006  ////////////////////////////////////////
            ////////// For all the Custom List the ListName field of XML file will be Used //////
            ////////if (Convert.ToInt32(ViewState["CategoryId"]) > 0)
            //////// lblHeader.Text = ViewState["ListName"].ToString();
            /////////////////////////////////////////////////////////////////////////////////////
        }
        else
        {
            lblHeader.Text = "OIs or AIDS Defining Illnesses";
        }
        DataTable theDTModule = (DataTable)Session["AppModule"];
        string    theModList  = "";

        foreach (DataRow theDR in theDTModule.Rows)
        {
            if (theModList == "")
            {
                theModList = theDR["ModuleId"].ToString();
            }
            else
            {
                theModList = theModList + "," + theDR["ModuleId"].ToString();
            }
        }
        ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
        DataTable   theDT         = CustomManager.GetCustomList(ViewState["TableName"].ToString(), Convert.ToInt32(ViewState["CategoryId"]), Convert.ToInt32(Session["SystemId"]));

        if (ViewState["gridSource"] == null)
        {
            ViewState["gridSource"]        = theDT;
            ViewState["gridSortDirection"] = "Desc";
        }

        grdCustom.DataSource = theDT;
        if (ViewState["TableName"].ToString().ToLower() == "HIVDisease".ToLower() || ViewState["TableName"].ToString().ToLower() == "Symptom".ToLower())
        {
            Bind_GridDiseaseSymptom();
        }
        else
        {
            Bind_Grid();
        }
    }
        protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)
        {
            ICustomList CustomManager;

            CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
            DataTable   DTFindRecord = new DataTable();
            ICustomList PriorManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

            DTFindRecord = CustomManager.GetCustomMasterLinkRecord(ViewState["TableName"].ToString(), Convert.ToInt32(ddlRegion.SelectedItem.Value));
            DataColumn[] thePKey = new DataColumn[2];
            thePKey[0] = DTFindRecord.Columns[0];
            thePKey[1] = DTFindRecord.Columns[2];
            DTFindRecord.PrimaryKey = thePKey;
            ViewState["GrdData"]    = DTFindRecord;
            Bind_Grid(DTFindRecord);
        }
Пример #24
0
    private static void Execute(string command, ICustomList <string> myList)
    {
        var commandArgs = command.Split();

        switch (commandArgs[0])
        {
        case "Add":
            myList.Add(commandArgs[1]);
            break;

        case "Remove":
            myList.Remove(int.Parse(commandArgs[1]));
            break;

        case "Contains":
            Console.WriteLine(myList.Contains(commandArgs[1]));
            break;

        case "Swap":
            myList.Swap(int.Parse(commandArgs[1]), int.Parse(commandArgs[2]));
            break;

        case "Greater":
            Console.WriteLine(myList.CountGreaterThan(commandArgs[1]));
            break;

        case "Min":
            Console.WriteLine(myList.Min());
            break;

        case "Max":
            Console.WriteLine(myList.Max());
            break;

        case "Print":
            Console.WriteLine(string.Join(Environment.NewLine, myList));
            break;

        case "Sort":
            myList.Sort();
            break;

        default:
            break;
        }
    }
        public void FillNonSelectd()
        {
            ICustomList   CustomManager;
            BindFunctions BindManager = new BindFunctions();

            CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
            DataTable   DTFindRecord = new DataTable();
            ICustomList PriorManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

            DTFindRecord = CustomManager.GetCustomMasterNonSelectedRecord(ViewState["TableName"].ToString());
            if (DTFindRecord != null)
            {
                //BindManager.BindCheckedList(chkDestict, DTFindRecord, "Name", "ID");
                DTFindRecord.Dispose();
                DTFindRecord.Clear();
            }
        }
Пример #26
0
        private void BindList()
        {
            try
            {
                ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
                DataSet     theDSList     = CustomManager.GetICDList();
                foreach (DataRow theDR1 in theDSList.Tables[0].Rows)
                {
                    ICDChapterCode       = new TreeNode();
                    ICDChapterCode.Text  = Convert.ToString(theDR1["ChapterName"]);
                    ICDChapterCode.Value = Convert.ToString(theDR1["ChapterCode"]);
                    TVICD10.Nodes.Add(ICDChapterCode);
                }
                TVICD10.ShowLines  = true;
                TVICD10.NodeIndent = 5;
                //TVICD10.CollapseAll();
            }
            catch { }

            finally { }
        }
Пример #27
0
    protected void lnkfullpath_Click(object sender, EventArgs e)
    {
        try
        {
            blnfullsearch    = true;
            blnPartialsearch = false;
            ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
            DataSet     theDSList     = CustomManager.GetICDList();
            foreach (DataRow theDR1 in theDSList.Tables[0].Rows)
            {
                ICDChapterCode       = new TreeNode();
                ICDChapterCode.Text  = Convert.ToString(theDR1["ChapterName"]);
                ICDChapterCode.Value = Convert.ToString(theDR1["ChapterCode"]);
                TVICD10.Nodes.Add(ICDChapterCode);
            }
            TVICD10.ShowLines  = true;
            TVICD10.NodeIndent = 5;
        }
        catch { }

        finally { }
    }
Пример #28
0
        private static void Main(string[] args)
        {
            CustomListClass cl = new CustomListClass();

            ICustomList list = cl as ICustomList;

            Console.WriteLine("Add 3 elements");

            list.Add(25);
            list.Add(26);
            list.Add(27);

            Console.WriteLine("The sum is " + list.Sum);

            Console.WriteLine("Set 0-th element");

            list.At[0] = 28;

            Console.WriteLine("The sum is " + list.Sum);

            Console.WriteLine("Iterate");

            Console.WriteLine("The size is " + list.Count);

            for (uint i = 0; i < list.Count; i++)
            {
                Console.WriteLine("\tItem at position " + i + " is " + list.At[i]);
            }

            Console.WriteLine("Remove 3 elements");

            list.Remove(28);
            list.Remove(26);
            list.Remove(27);

            Console.WriteLine("The size is " + list.Count);
            Console.WriteLine("The sum is " + list.Sum);
        }
Пример #29
0
    protected void ddlVillage_SelectedIndexChanged1(object sender, EventArgs e)
    {
        ICustomList CustomManager;

        CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
        DataTable   DTFindRecord = new DataTable();
        ICustomList PriorManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

        if (ddlRegion.SelectedItem.Value != "0" && ddDistric.SelectedItem.Value != "0" && ddWard.SelectedItem.Value != "0" && ddlVillage.SelectedItem.Value != "0")
        {
            DTFindRecord = CustomManager.GetVillageChairperson(Convert.ToInt32(ddlRegion.SelectedItem.Value), Convert.ToInt32(ddDistric.SelectedItem.Value), Convert.ToInt32(ddWard.SelectedItem.Value), Convert.ToInt32(ddlVillage.SelectedItem.Value));
            if (DTFindRecord.Rows.Count > 0)
            {
                txtChairPerson.Text = DTFindRecord.Rows[0][0].ToString();
                btnSave.Text        = "Update";
            }
            else
            {
                txtChairPerson.Text = "";
                btnSave.Text        = "Save";
            }
        }
    }
Пример #30
0
        protected void TVICD10_SelectedNodeChanged(object sender, EventArgs e)
        {
            object SelectedValue = ((TreeView)sender).SelectedValue;

            if (((TreeView)sender).SelectedNode.Depth == 0)
            {
                TVICD10.Nodes.Clear();
                SelectedBindBlock(Convert.ToInt32(SelectedValue), 0);
                TVICD10.SelectedNodeStyle.Font.Underline = true;
            }
            else if (((TreeView)sender).SelectedNode.Depth == 1)
            {
                ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
                DataSet     theDSList     = CustomManager.GetICDList();
                DataView    theDV         = new DataView(theDSList.Tables[1]);
                theDV.RowFilter = "BlockId=" + SelectedValue.ToString();
                DataTable theDT = theDV.ToTable();
                TVICD10.Nodes.Clear();
                SelectedBindSubBlock(Convert.ToInt32(SelectedValue), 1, Convert.ToInt32(theDT.Rows[0][1]));
                TVICD10.SelectedNodeStyle.Font.Underline = true;
            }
            else if (((TreeView)sender).SelectedNode.Depth == 2)
            {
                ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
                DataSet     theDSList     = CustomManager.GetICDList();
                DataView    theDV         = new DataView(theDSList.Tables[2]);
                theDV.RowFilter = "SubBlockId=" + SelectedValue.ToString();
                DataTable theDT = theDV.ToTable();
                theDV           = new DataView(theDSList.Tables[1]);
                theDV.RowFilter = "BlockId=" + Convert.ToString(theDT.Rows[0][0]);
                DataTable theDT1 = theDV.ToTable();
                TVICD10.Nodes.Clear();
                SelectedBindICDCodes(Convert.ToInt32(SelectedValue), 2, Convert.ToInt32(theDT.Rows[0][0]), Convert.ToInt32(theDT1.Rows[0][1]));
                TVICD10.SelectedNodeStyle.Font.Underline = true;
                TVICD10.SelectedNodeStyle.ForeColor      = System.Drawing.Color.Red;
            }
        }
Пример #31
0
 public CommandInterpreter(ICustomList<string> list)
 {
     this.list = list;
 }