private void but_addall_Click(object sender, EventArgs e)
        {
            CnasUtilityTools.MoveData(dgv_01, dgv_02, false, true);
            //if(dgv_01.Rows.Count>0)
            //{
            //    for(int i=0;i<dgv_01.Rows.Count;i++)
            //    {
            //        string str_id = "", str_app_name = "", str_app_briefcode = "";
            //        if (dgv_01.Rows[i].Cells["id"] != null) str_id = dgv_01.Rows[i].Cells["id"].Value.ToString();
            //        if (dgv_01.Rows[i].Cells["app_name"] != null) str_app_name = dgv_01.Rows[i].Cells["app_name"].Value.ToString();
            //        if (dgv_01.Rows[i].Cells["app_briefcode"] != null) str_app_briefcode = dgv_01.Rows[i].Cells["app_briefcode"].Value.ToString();
            //        DataGridViewRow drtemp01 = new DataGridViewRow();
            //        drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//简码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
            //        drtemp01.SetValues(false, str_id, str_app_briefcode, str_app_name);
            //        dgv_02.Rows.Add(drtemp01);
            //        sl_gpapp.Add(str_id, str_app_name);

            //    }
            //    dgv_01.Rows.Clear();
            //    sl_allapp.Clear();
            //}
        }
        private void but_reall_Click(object sender, EventArgs e)
        {
            CnasUtilityTools.MoveData(radDgv_01, radDgv_02, false, false);

            //if (radDgv_02.Rows.Count > 0)
            //{

            //    for (int i = 0; i < radDgv_02.Rows.Count; i++)
            //    {
            //        string str_id = "", str_cc_name = "";
            //        if (radDgv_02.Rows[i].Cells["id2"] != null) str_id = radDgv_02.Rows[i].Cells["id2"].Value.ToString();
            //        if (radDgv_02.Rows[i].Cells["ca_name2"] != null) str_cc_name = radDgv_02.Rows[i].Cells["ca_name2"].Value.ToString();

            //        DataGridViewRow drtemp01 = new DataGridViewRow();
            //        drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
            //        drtemp01.SetValues(false, str_id, str_cc_name);
            //        radDgv_01.Rows.Add(drtemp01);
            //        sl_allapp.Add(str_id, str_cc_name);
            //    }
            //    radDgv_02.Rows.Clear();
            //    sl_gpapp.Clear();
            //}
        }
예제 #3
0
        private void but_reone_Click(object sender, EventArgs e)
        {
            //if (dgv_02.Rows.Count > 0)
            //{
            //    //添加dgv_01数据
            //    for (int i = 0; i < dgv_02.Rows.Count; i++)
            //    {
            //        if (bool.Parse(dgv_02.Rows[i].Cells["isselected2"].Value.ToString()) == false) continue;
            //        string str_id = "", str_group_name = "", str_group_type = "";
            //        if (dgv_02.Rows[i].Cells["group_id2"] != null) str_id = dgv_02.Rows[i].Cells["group_id2"].Value.ToString();
            //        if (dgv_02.Rows[i].Cells["user_name2"] != null) str_group_name = dgv_02.Rows[i].Cells["user_name2"].Value.ToString();
            //        if (dgv_02.Rows[i].Cells["group_type2"] != null) str_group_type = dgv_02.Rows[i].Cells["group_type2"].Value.ToString();
            //        DataGridViewRow drtemp01 = new DataGridViewRow();
            //        drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//简码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
            //        drtemp01.SetValues(false, str_id, str_group_name, str_group_type);
            //        dgv_01.Rows.Add(drtemp01);
            //        sl_01data.Add(str_id, str_group_name);
            //    }

            //    dgv_02.Rows.Clear();
            //    sl_02data.Clear();

            //    //刷新dgv_02数据
            //    for (int i = 0; i < dtall.Rows.Count; i++)
            //    {
            //        string str_id = "", str_group_name = "", str_group_type = "";
            //        if (dtall.Rows[i]["id"] != null) str_id = dtall.Rows[i]["id"].ToString();
            //        if (dtall.Rows[i]["group_name"] != null) str_group_name = dtall.Rows[i]["group_name"].ToString();
            //        if (dtall.Rows[i]["group_type"] != null) str_group_type = dtall.Rows[i]["group_type"].ToString();
            //        DataGridViewRow drtemp01 = new DataGridViewRow();
            //        drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//简码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
            //        drtemp01.SetValues(false, str_id, str_group_name, str_group_type);
            //        if (sl_01data.IndexOfKey(str_id) < 0)
            //        {
            //            dgv_02.Rows.Add(drtemp01);
            //            sl_02data.Add(str_id, str_group_name);
            //        }
            //    }
            //}
            CnasUtilityTools.MoveData(dgv_01, dgv_02, true, false);
        }
        private void but_addone_Click(object sender, EventArgs e)
        {
            CnasUtilityTools.MoveData(dgv_01, dgv_02, true, true);
            //if (dgv_01.Rows.Count > 0)
            //{
            //    //SortedList sol_select = new SortedList();
            //    for (int i = 0; i < dgv_01.Rows.Count; i++)
            //    {
            //        if (bool.Parse( dgv_01.Rows[i].Cells["isselected"].Value.ToString()) == false) continue;
            //        string str_id = "", str_app_name = "", str_app_briefcode = "";
            //        if (dgv_01.Rows[i].Cells["id"] != null) str_id = dgv_01.Rows[i].Cells["id"].Value.ToString();
            //        if (dgv_01.Rows[i].Cells["app_name"] != null) str_app_name = dgv_01.Rows[i].Cells["app_name"].Value.ToString();
            //        if (dgv_01.Rows[i].Cells["app_briefcode"] != null) str_app_briefcode = dgv_01.Rows[i].Cells["app_briefcode"].Value.ToString();
            //        DataGridViewRow drtemp01 = new DataGridViewRow();
            //        drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//简码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
            //        drtemp01.SetValues(false, str_id, str_app_briefcode, str_app_name);
            //        dgv_02.Rows.Add(drtemp01);
            //        sl_gpapp.Add(str_id, str_app_name);
            //    }

            //    dgv_01.Rows.Clear();
            //    sl_allapp.Clear();
            //    DataRow[] arrayDR = dtappall.Select("app_type=1");
            //    foreach (DataRow dr in arrayDR)
            //    {
            //        string str_id = "", str_app_name = "", str_app_briefcode = "";
            //        if (dr["id"] != null) str_id = dr["id"].ToString();
            //        if (dr["app_name"] != null) str_app_name = dr["app_name"].ToString();
            //        if (dr["app_briefcode"] != null) str_app_briefcode = dr["app_briefcode"].ToString();
            //        DataGridViewRow drtemp01 = new DataGridViewRow();
            //        drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//简码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
            //        drtemp01.SetValues(false, str_id, str_app_briefcode, str_app_name);
            //        if (sl_gpapp.IndexOfKey(str_id) < 0)
            //        {
            //            dgv_01.Rows.Add(drtemp01);
            //            sl_allapp.Add(str_id, str_app_name);
            //        }
            //    }
            //}
        }
        private void but_reone_Click(object sender, EventArgs e)
        {
            CnasUtilityTools.MoveData(radDgv_01, radDgv_02, true, false);
            //if (radDgv_02.Rows.Count > 0)
            //{
            //    for (int i = 0; i < radDgv_02.Rows.Count; i++)
            //    {
            //        if (bool.Parse(radDgv_02.Rows[i].Cells["isselected2"].Value.ToString()) == false) continue;
            //        string str_id = "", str_app_name = "";
            //        if (radDgv_02.Rows[i].Cells["id2"] != null) str_id = radDgv_02.Rows[i].Cells["id2"].Value.ToString();
            //        if (radDgv_02.Rows[i].Cells["ca_name2"] != null) str_app_name = radDgv_02.Rows[i].Cells["ca_name2"].Value.ToString();

            //        DataGridViewRow drtemp01 = new DataGridViewRow();
            //        drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
            //        drtemp01.SetValues(false, str_id, str_app_name);
            //        radDgv_01.Rows.Add(drtemp01);
            //        sl_allapp.Add(str_id, str_app_name);
            //    }

            //    radDgv_02.Rows.Clear();
            //    sl_gpapp.Clear();
            //    DataRow[] arrayDR = dtccall.Select();
            //    foreach (DataRow dr in arrayDR)
            //    {
            //        string str_id = "", str_app_name = "";
            //        if (dtccall.Columns.Contains("id") && dr["id"] != null) str_id = dr["id"].ToString();
            //        if (dtccall.Columns.Contains("ca_name") && dr["ca_name"] != null) str_app_name = dr["ca_name"].ToString();

            //        DataGridViewRow drtemp01 = new DataGridViewRow();
            //        drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
            //        drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
            //        drtemp01.SetValues(false, str_id, str_app_name);
            //        if (sl_allapp.IndexOfKey(str_id) < 0)
            //        {
            //            radDgv_02.Rows.Add(drtemp01);
            //            sl_gpapp.Add(str_id, str_app_name);
            //        }
            //    }
            //}
        }
예제 #6
0
        private void but_addone_Click(object sender, EventArgs e)
        {
            CnasUtilityTools.MoveData(dgv_01, dgv_02, true, true);
            //if (dgv_01.Rows.Count > 0)
            //{
            //	//SortedList sol_select = new SortedList();
            //	for (int i = 0; i < dgv_01.Rows.Count; i++)
            //	{
            //		//if (bool.Parse(dgv_01.Rows[i].Cells["isselected"].Value.ToString()) == null) continue;
            //		if (dgv_01.Rows[i].Cells["isselected"].Value == null) continue;
            //		string str_id = "", str_group_name = "";
            //		if (dgv_01.Rows[i].Cells["id"] != null) str_id = dgv_01.Rows[i].Cells["id"].Value.ToString();
            //		if (dgv_01.Rows[i].Cells["ca_name"] != null) str_group_name = dgv_01.Rows[i].Cells["ca_name"].Value.ToString();
            //		DataGridViewRow drtemp01 = new DataGridViewRow();
            //		drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //		drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
            //		drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
            //		drtemp01.SetValues(false, str_id, str_group_name);
            //		dgv_02.Rows.Add(drtemp01);
            //		sl_data02.Add(str_id, str_group_name);
            //	}

            //	dgv_01.Rows.Clear();
            //	sl_data01.Clear();

            //	for (int i = 0; i < Dataset.Rows.Count; i++)
            //	{
            //		string str_id = "", str_group_name = "";
            //		if (Dataset.Columns.Contains("id") && Dataset.Rows[i]["id"] != null) str_id = Dataset.Rows[i]["id"].ToString();
            //		if (Dataset.Columns.Contains("ca_name") && Dataset.Rows[i]["ca_name"] != null) str_group_name = Dataset.Rows[i]["ca_name"].ToString();
            //		DataGridViewRow drtemp01 = new DataGridViewRow();
            //		drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //		drtemp01.Cells.Add(new DataGridViewTextBoxCell());//编码
            //		drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
            //		drtemp01.SetValues(false, str_id, str_group_name);
            //		if (sl_data02.IndexOfKey(str_id) < 0)
            //		{
            //			dgv_01.Rows.Add(drtemp01);
            //			sl_data01.Add(str_id, str_group_name);
            //		}
            //	}
            //}
        }
예제 #7
0
        private void but_reall_Click(object sender, EventArgs e)
        {
            CnasUtilityTools.MoveData(dgv_01, dgv_02, false, false);
            //if (dgv_02.Rows.Count > 0)
            //{
            //	for (int i = 0; i < dgv_02.Rows.Count; i++)
            //	{
            //		string str_id = "", str_group_name = "";
            //		if (dgv_02.Rows[i].Cells["id2"] != null) str_id = dgv_02.Rows[i].Cells["id2"].Value.ToString();
            //		if (dgv_02.Rows[i].Cells["ca_name2"] != null) str_group_name = dgv_02.Rows[i].Cells["ca_name2"].Value.ToString();

            //		DataGridViewRow drtemp01 = new DataGridViewRow();
            //		drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //		drtemp01.Cells.Add(new DataGridViewTextBoxCell());//ID
            //		drtemp01.Cells.Add(new DataGridViewTextBoxCell());//名字
            //		drtemp01.SetValues(false, str_id, str_group_name);
            //		dgv_01.Rows.Add(drtemp01);
            //		sl_data01.Add(str_id, str_group_name);
            //	}
            //	dgv_02.Rows.Clear();//把所有dgv_01行清空
            //	sl_data02.Clear();//把sl_01data清空
            //}
        }
        private void but_reone_Click(object sender, EventArgs e)
        {
            CnasUtilityTools.MoveData(dgv_01, dgv_02, true, false);
            //if (dgv_02.Rows.Count > 0)
            //{
            //    for (int i = 0; i < dgv_02.Rows.Count; i++)
            //    {
            //        if (dgv_02.Rows[i].Cells["isselect02"].Value == null) continue;
            //        if (bool.Parse(dgv_02.Rows[i].Cells["isselect02"].Value.ToString()) == false) continue;
            //        string str_id = "", str_app_name = "";
            //        if (dgv_02.Rows[i].Cells["id02"] != null) str_id = dgv_02.Rows[i].Cells["id02"].Value.ToString();

            //        if (dgv_02.Rows[i].Cells["ca_name02"] != null) str_app_name = dgv_02.Rows[i].Cells["ca_name02"].Value.ToString();
            //        try//抛异常的为重复的,移除重复的
            //        {
            //            sl_02data.Add(str_id, str_app_name);
            //        }
            //        catch
            //        {
            //            sl_02data.Remove(str_id);
            //        }
            //    }
            //}
        }
예제 #9
0
 private void but_addone_Click(object sender, EventArgs e)
 {
     CnasUtilityTools.MoveData(dgv_01, dgv_02, true, true);
 }
예제 #10
0
 private void but_reall_Click(object sender, EventArgs e)
 {
     CnasUtilityTools.MoveData(dgv_01, dgv_02, false, false);
     enable();
 }
        private void but_addone_Click(object sender, EventArgs e)
        {
            //dgv_02.Rows.Clear();
            //sl_02data.Clear();
            CnasUtilityTools.MoveData(dgv_01, dgv_02, true, true);
            //if (dgv_01.Rows.Count > 0)
            //{
            //    //SortedList sol_select = new SortedList();


            //    string str_id = "", str_app_name = "";
            //    if (dgv_02.Rows.Count == 0)//如果dgv_02没数据,则第一次添加数据,后面查重会赛选
            //    {
            //        for (int k = 0; k < dgv_01.Rows.Count; k++)
            //        {
            //            if (dgv_01.Rows[k].Cells["isselected"].Value == null) continue;
            //            if (bool.Parse(dgv_01.Rows[k].Cells["isselected"].Value.ToString()) == false) continue;
            //            if (dgv_01.Rows[k].Cells["id"] != null) str_id = dgv_01.Rows[k].Cells["id"].Value.ToString();
            //            if (dgv_01.Rows[k].Cells["ca_name"] != null) str_app_name = dgv_01.Rows[k].Cells["ca_name"].Value.ToString();

            //            DataGridViewRow drtemp01 = new DataGridViewRow();
            //            drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //            drtemp01.Cells.Add(new DataGridViewTextBoxCell());//ID
            //            drtemp01.Cells.Add(new DataGridViewTextBoxCell());//器械名

            //            drtemp01.SetValues(false, str_id, str_app_name);
            //            dgv_02.Rows.Add(drtemp01);
            //            sl_02data.Add(str_id, str_app_name);
            //        }
            //    }
            //    else
            //    {
            //        int sum = 0;//判断重复
            //        for (int i = 0; i < dgv_01.Rows.Count; i++)
            //        {
            //            if (dgv_01.Rows[i].Cells["isselected"].Value == null) continue;
            //            if (bool.Parse(dgv_01.Rows[i].Cells["isselected"].Value.ToString()) == false) continue;
            //            for (int j = 0; j < dgv_02.Rows.Count; j++)//循环查重
            //            {
            //                if (dgv_01.Rows[i].Cells["id"].Value.ToString() != dgv_02.Rows[j].Cells["id02"].Value.ToString())//如果dgv_02中已经存这个id的器械,则不添加
            //                {
            //                    sum++;
            //                }
            //                else
            //                {
            //                    sum--;
            //                }



            //            }
            //            if (sum == dgv_02.Rows.Count)//如果相等,则说明这个器械已经与表全部器械比较过了,不重复,可以添加
            //            {
            //                if (dgv_01.Rows[i].Cells["id"] != null) str_id = dgv_01.Rows[i].Cells["id"].Value.ToString();
            //                if (dgv_01.Rows[i].Cells["ca_name"] != null) str_app_name = dgv_01.Rows[i].Cells["ca_name"].Value.ToString();

            //                DataGridViewRow drtemp01 = new DataGridViewRow();
            //                drtemp01.Cells.Add(new DataGridViewCheckBoxCell());//选择
            //                drtemp01.Cells.Add(new DataGridViewTextBoxCell());//ID
            //                drtemp01.Cells.Add(new DataGridViewTextBoxCell());//器械名

            //                drtemp01.SetValues(false, str_id, str_app_name);
            //                dgv_02.Rows.Add(drtemp01);
            //                sl_02data.Add(str_id, str_app_name);
            //            }
            //            sum = 0;
            //        }
            //    }



            //}
        }